Commit 3ac0c0cf by Vo Duc Thang

10/2 リリース

parent 610779d3
This source diff could not be displayed because it is too large. You can view the blob instead.
/** eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('1 c="/1b/b/3";1 G="/1c";1 e="1a";1 y="18";$(6(){1 u=9.u.19().1d();4(u.L(G)<0){c="."+G+c}m{c="."+c}1 3="o";1 5=9.U;4(5){1 3=5.q(e);4(!3){3=v()}}C(3)});6 v(){1 3=(H.1i||H.N||H.1e);1 D=[\'S\',\'I\',\'o\'];4(3.1f(/S|I|o/g)){K(1 i=0;i<D.J;i++){1 F=3.L(D[i]);4(F>=0){3=3.16(F,2);15}}}m{3=\'o\';}f 3};6 C(3){1 k="3-"+3+".b";$.17({13:c+"/"+k,12:P,1j:\'b\',1w:P,1z:6(O){1x.1v.3=3;1 7=O;w(7);W(3,7)},l:6(R,Q,M){1 l=\'1C 1A 1D a N 1n \'+k+\'. 1o 1m 1k.\';l+=\'\\n\'+R.1p+\' \'+Q+\' \'+M+\' : \'+k;1s(l)}})};6 w(7){1 z=$(\'.3\').J;4(z>0){K(1 i=0;i<z;i++){1 8=$(\'.3:1r(\'+i+\')\');1 A=8.x(\'3\');4(A){1 p=E(7,A);1 V=8.1q()[0].1u;4(V==\'1t\'){4(8.x(\'X\')==\'1l\'||8.x(\'X\')==\'1B\'){8.1y(p)}m{8.h(p)}}m{8.h(p)}}}}};6 11(){1 5=9.s;4(5){1 d=5.q(e);4(d){1 b=B.Z(d);w(b)}}};6 14(j){1 5=9.s;4(5){1 d=5.q(e);4(d){1 b=B.Z(d);f E(b,j)}}f"Y"};6 E(7,j){4(7){1 h=7[j];f h}f"Y."};6 10(3){1 5=9.U;4(5){5.t(e,3)}C(3)};6 W(3,T){1 r=9.s;4(r){r.t(e,B.1g(T));r.t(y,3)}};6 1h(){1 3;1 5=9.s;4(5){3=5.q(y)}4(!3){3=v()}f 3};', 62, 102, '|var||lang|if|storage|function|jsonLangData|obj|window||json|avwsys_location|value|avwsys_storagekey|return||text||key|langfile|error|else||en|langText|getItem|ss|sessionStorage|setItem|location|getNavigatorLanguage|replaceText|attr|avwsys_currLang|itemCount|langId|JSON|loadLanguage|languages|getLangText|index|avwsys_dir|navigator|ko|length|for|indexOf|errorThrown|language|data|false|txtStatus|xhr|ja|langData|localStorage|tn|storeCurrentLanguage|type|undefined|parse|changeLanguage|i18nReplaceText|async|url|i18nText|break|substring|ajax|AVW_CurrLang|toString|AVWUS_Lang|common|abvw|toLowerCase|userLanguage|match|stringify|getCurrentLanguage|browserLanguage|dataType|it|button|check|file|please|status|get|eq|alert|input|localName|documentElement|cache|document|val|success|not|submit|Could|load'.split('|'), 0, {}))
* ABook Viewer for WEB
* 国際化(言語切替)対応共通処理
*
* 言語リソースファイルは、指定する言語に合わせて以下のファイルを修正する
* - 日本語: lang-ja.json
* - 韓国語: lang-ko.json
* - 英語 : lang-en.json
*
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
/**
* 定数:言語ファイル配置場所
*/
var avwsys_location = "/common/json/lang";
var avwsys_dir = "/abvw";
var avwsys_storagekey = "AVWUS_Lang";
var avwsys_currLang = "AVW_CurrLang";
/* 言語の初期化 */
$(function() {
// ログイン画面/直接アクセス対策
var location = window.location.toString().toLowerCase();
if (location.indexOf(avwsys_dir) < 0) {
// avwsys_dirディレクトリ配下ではない場合は、avwsys_dirディレクトリをつける
avwsys_location = "." + avwsys_dir + avwsys_location;
} else {
// avwsys_dirディレクトリ配下の場合は、相対パスに変換
avwsys_location = "." + avwsys_location;
}
var lang = "en";
var storage = window.localStorage;
if(storage) {
var lang = storage.getItem(avwsys_storagekey);
if(!lang) {
lang = getNavigatorLanguage();
}
}
// 言語ファイルを初期化する
loadLanguage(lang);
});
/* ブラウザの言語設定を取得する */
function getNavigatorLanguage() {
var lang = (navigator.browserLanguage || navigator.language || navigator.userLanguage);
/* 対応言語 */
var languages = ['ja','ko','en']; // 対応言語を増やす場合はここを変更する
if(lang.match(/ja|ko|en/g)) {
for(var i = 0; i < languages.length; i++) {
var index = lang.indexOf(languages[i]);
if(index >= 0) {
lang = lang.substring(index, 2);
break;
}
}
} else {
lang = 'en'; // 対応言語が無ければ英語をデフォルトとする
}
return lang;
};
/* 言語リソースファイル読み込み */
function loadLanguage(lang) {
// 引数から言語ファイルを選択
var langfile = "lang-" + lang + ".json";
// 言語ファイルを読み込む
$.ajax({
url: avwsys_location + "/" + langfile,
async: false,
dataType: 'json',
cache: false,
success: function(data) {
// lang属性の書換え
document.documentElement.lang = lang;
// html の言語データを書換える
var jsonLangData = data;
replaceText(jsonLangData);
// 言語設定、言語データをストレージにキャッシュしておく
storeCurrentLanguage(lang, jsonLangData);
},
error: function(xhr, txtStatus, errorThrown) {
var error = 'Could not load a language file ' + langfile + '. please check it.';
error += '\n' + xhr.status + ' ' + txtStatus + ' ' + errorThrown + ' : ' + langfile;
alert(error);
}
});
};
/* ページ内のテキストをすべて言語に合わせて置換する */
function replaceText(jsonLangData) {
var itemCount = $('.lang').length;
if(itemCount > 0) {
for(var i = 0; i < itemCount; i++) {
var obj = $('.lang:eq(' + i + ')');
var langId = obj.attr('lang');
if(langId) {
var langText = getLangText(jsonLangData, langId);
var tn = obj.get()[0].localName;
if(tn == 'input') {
if(obj.attr('type') == 'button' || obj.attr('type') == 'submit') {
obj.val(langText);
} else {
obj.text(langText);
}
} else {
obj.text(langText);
}
}
}
}
};
/* 現在設定されている言語でHTMLテキストを置き換える */
function i18nReplaceText() {
var storage = window.sessionStorage;
if(storage) {
var value = storage.getItem(avwsys_storagekey);
if(value) {
var json = JSON.parse(value);
replaceText(json);
}
}
};
/* キーから文字列を取得 */
function i18nText(key) {
var storage = window.sessionStorage;
if(storage) {
var value = storage.getItem(avwsys_storagekey);
if(value) {
var json = JSON.parse(value);
return getLangText(json, key);
}
}
return "undefined";
};
/* 言語データのキー値から文字列を取得 */
function getLangText(jsonLangData, key) {
if(jsonLangData) {
var text = jsonLangData[key];
return text;
}
return "undefined.";
};
/* 言語データの切り替え */
function changeLanguage(lang) {
// 言語の切替を行った場合のみ選択言語をストアする
var storage = window.localStorage;
if(storage) {
storage.setItem(avwsys_storagekey, lang);
}
// 言語ファイルを読み込み、テキスト文字列を変換する
loadLanguage(lang);
};
/* 設定言語の保存 */
function storeCurrentLanguage(lang, langData) {
var ss = window.sessionStorage;
if(ss) {
// language data
ss.setItem(avwsys_storagekey, JSON.stringify(langData));
// current language
ss.setItem(avwsys_currLang, lang);
}
};
/* 設定言語の取得 */
function getCurrentLanguage() {
var lang;
var storage = window.sessionStorage;
if(storage) {
lang = storage.getItem(avwsys_currLang);
}
if(!lang) {
lang = getNavigatorLanguage();
}
return lang;
};
$(function() { eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('$(p(){b(3.2==\'a\'||3.2==\'c\'){}e{$(\'.d\').1({0:\'s\'});$(\'.9\').1({0:\'s\'});$(\'.4\').1({0:\'s\'});$(\'.5\').1({0:\'s\'});$(\'.6\').1({0:\'s\'});$(\'.7\').1({0:\'s\'});$(\'.8\').1({0:\'s\'});$(\'.i\').1({0:\'s\'});$(\'.o\').1({0:\'s\'});$(\'.m\').1({0:\'s\'});$(\'.r\').1({0:\'n\'});$(\'.q\').1({0:\'n\'});$(\'.l\').1({0:\'n\'});$(\'.h\').1({0:\'n\'});$(\'.g\').1({0:\'n\'});$(\'.f\').1({0:\'n\'});$(\'.k\').1({0:\'n\'});$(\'.j\').1({0:\'n\'})}});', 29, 29, 'placement|powerTip|os|avwUserEnvObj|bmList|bmAdd|index|copy|memoDisplay|back|ipad|if|android|home|else|fit|expansion|last|memoAdd|toolbar|reduction|next|markingToolbar||marking|function|prev|begin|'.split('|'), 0, {}))
if(avwUserEnvObj.os == 'ipad' || avwUserEnvObj.os == 'android'){
}else{
// placement examples
$('.home').powerTip({placement: 's'});
$('.back').powerTip({placement: 's'});
$('.bmList').powerTip({placement: 's'});
$('.bmAdd').powerTip({placement: 's'});
$('.index').powerTip({placement: 's'});
$('.copy').powerTip({placement: 's'});
$('.memoDisplay').powerTip({placement: 's'});
$('.memoAdd').powerTip({placement: 's'});
$('.marking').powerTip({placement: 's'});
$('.markingToolbar').powerTip({placement: 's'});
$('.begin').powerTip({placement: 'n'});
$('.prev').powerTip({placement: 'n'});
$('.next').powerTip({placement: 'n'});
$('.last').powerTip({placement: 'n'});
$('.expansion').powerTip({placement: 'n'});
$('.fit').powerTip({placement: 'n'});
$('.reduction').powerTip({placement: 'n'});
$('.toolbar').powerTip({placement: 'n'});
}
});
$(function() { eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('$(4(){$("c.5 7 a").e(4(){$("h.g").k(4(i){2 3="#j"+i;f($(3).1("0")=="b"){$(3).1("0","q")}});$("c.5 7 a").r("8");$(6).p("8");2 d=$(6).m("l");2 9=d;$(9).1("0","b");o n})});', 28, 28, 'display|css|var|thisID|function|switchingTab|this|li|current|tabTargetID||block|ul|tabTarget|click|if|tabUnitList|div||list_|each|href|attr|false|return|addClass|none|removeClass'.split('|'), 0, {}))
$("ul.switchingTab li a").click(function(){
$("div.tabUnitList").each(
function(i) {
var thisID = "#list_"+i;
if($(thisID).css("display") == "block"){
$(thisID).css("display","none");
}
}
);
$("ul.switchingTab li a").removeClass("current");
$(this).addClass("current");
var tabTarget = $(this).attr("href");
var tabTargetID = tabTarget;
$(tabTargetID).css("display","block");
return false;
});
});
/** eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('D 15(b,z,Z){3 l=17.18(\'l\');l.b=b;l.z=z;3 5=l.16(\'14\');3 J=\'\';3 7=0;3 K=0;3 n=0;3 r=b;3 8=0;3 s=Q;3 e=\'F\';3 a=2;J=Z.9(/\\\\/,\'\');1g(J,{1j:D(A,d,1i){3 t=A.m();4(t==\'1e\'){3 f;y(3 i=0;i<d.p;i++){3 h=d[i].X.m();4(h==\'f\'){f=d[i].B;e=f}}4(f==\'F\'){8=0;5.e=\'F\'}q 4(f==\'M\'){8=r/2;5.e=\'M\'}q 4(f==\'I\'){8=r;5.e=\'I\'}}4(t==\'N\'){3 O=\'1a 19\';3 E=\'1b\';3 L=\'#1d\';y(3 i=0;i<d.p;i++){3 h=d[i].X.m();4(h==\'1c\'){O=d[i].B}4(h==\'o\'){3 S=d[i].B;3 H=S.U(\';\');y(3 j=0;j<H.p;j++){3 o=H[j].U(\':\');4(o[0].m()==\'N-1h\'){E=o[1]}4(o[0].m()==\'1f-z\'){K=T(o[1].9(\'W\',\'\'))}}}4(h==\'1x\'){L=d[i].B}}5.N=E+" "+"\'"+O+"\'";5.G=L;n=T(E.9(\'W\',\'\'))*(K/1y)}4(t==\'1z\'){7+=(n+a)}4(t==\'u\'){s=1v}},1w:D(A){3 t=A.m();4(t==\'u\'){s=Q}},1A:D(6){6=6.9(/&1u;/g,\' \');6=6.9(/&1n;/g,\'>\');6=6.9(/&1o;/g,\'<\');6=6.9(/&1m;/g,\'&\');6=6.9(/&1k;/g,\'(C)\');6=6.9(/&1l;/g,\'(R)\');6=6.9(/&1s;/g,\'\\\\\');4(7==0){7+=n/2}3 w=0;3 1t=0;3 c=\'\';y(3 i=0;i<6.p;i++){3 k=5.1r(c+6.P(i),8,7);4(k.b<r){c+=6.P(i)}q{5.c(c,8,7+a);4(s){5.10();5.12(0,7+a);5.Y(r,7+a);5.11=5.G;5.13()}7+=(n+a);c=6.P(i)}}4(c.p>0){5.c(c,8,7+a);4(s){3 v,x;4(e==\'F\'){v=0;x=k.b}q 4(e==\'M\'){v=8-(k.b/2);x=8+(k.b/2)}q 4(e=-\'I\'){v=8;x=8-k.b}5.10();5.12(v,7+a);5.Y(x,7+a);5.11=5.G;5.13()}7+=(n+a)}}});3 V=l.1p();1q V};', 62, 99, '|||var|if|context|text|currentLine|startPosition|replace|margin|width|fillText|attrs|textAlign|align||attrName|||metrices|canvas|toLowerCase|nextLinePosition|style|length|else|lineWidth|hasUnderLine|||x1||x2|for|height|tag|escaped||function|fontSize|left|fillStyle|styles|right|dataHtml|lineHeight|fontColor|center|font|fontFace|charAt|false||styleBase|parseInt|split|imageUrl|px|name|lineTo|htmlData|beginPath|strokeStyle|moveTo|stroke|2d|getTextObjectImage|getContext|document|createElement|Pゴシック|MS|11px|face|000000|div|line|HTMLParser|size|unary|start|copy|reg|amp|gt|lt|toDataURL|return|measureText|yen|index|nbsp|true|end|color|100|br|chars'.split('|'), 0, {}))
* ABook Viewer for WEB
* Drawing HTML Text Library
* **this library depend on htmlparser.js**
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
/**
* get HTML Text Image URL
*/
function getTextObjectImage(width, height, htmlData) {
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
var context = canvas.getContext('2d');
var dataHtml = '';
var currentLine = 0;
var lineHeight = 0;
var nextLinePosition = 0;
var lineWidth = width; // 1行の幅
var startPosition = 0; // テキスト描画の開始位置
var hasUnderLine = false; // アンダーラインの有無
var textAlign = 'left'; // テキスト揃え
var margin = 2;
/* remove escape charactor '\' */
dataHtml = htmlData.replace(/\\/, '');
//dataHtml = dataHtml.toLowerCase();
//console.log('dataHtml:' + dataHtml);
// parse
HTMLParser(dataHtml,
{
start: function (tag, attrs, unary) {
var t = tag.toLowerCase();
/*
* DIVタグ
*/
if (t == 'div') {
var align;
for (var i = 0; i < attrs.length; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName == 'align') {
align = attrs[i].escaped;
textAlign = align;
}
}
if (align == 'left') {
startPosition = 0;
context.textAlign = 'left';
} else if (align == 'center') {
startPosition = lineWidth / 2;
context.textAlign = 'center';
} else if (align == 'right') {
startPosition = lineWidth;
context.textAlign = 'right';
}
}
/*
* FONTタグ
*/
if (t == 'font') {
var fontFace = 'MS Pゴシック';
var fontSize = '11px';
var fontColor = '#000000';
for (var i = 0; i < attrs.length; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName == 'face') {
fontFace = attrs[i].escaped;
}
if (attrName == 'style') {
var styleBase = attrs[i].escaped;
var styles = styleBase.split(';');
for (var j = 0; j < styles.length; j++) {
var style = styles[j].split(':');
if (style[0].toLowerCase() == 'font-size') {
fontSize = style[1];
}
if (style[0].toLowerCase() == 'line-height') {
lineHeight = parseInt(style[1].replace('px', ''));
}
}
}
if (attrName == 'color') {
fontColor = attrs[i].escaped;
}
}
// context に設定
context.font = fontSize + " " + "'" + fontFace + "'";
context.fillStyle = fontColor;
// 行間
nextLinePosition = parseInt(fontSize.replace('px', '')) * (lineHeight / 100);
}
/*
* BR タグ
*/
if (t == 'br') {
currentLine += (nextLinePosition + margin);
}
/*
* Uタグ
*/
if (t == 'u') {
hasUnderLine = true;
}
},
end: function (tag) {
var t = tag.toLowerCase();
/*
* Uタグ
*/
if (t == 'u') {
hasUnderLine = false;
}
},
chars: function (text) {
// エンティティ文字を置換
// &nbsp; &gt; &lt; &amp; &yen; &copy; &reg; のみ対応
text = text.replace(/&nbsp;/g, ' ');
text = text.replace(/&gt;/g, '>');
text = text.replace(/&lt;/g, '<');
text = text.replace(/&amp;/g, '&');
text = text.replace(/&copy;/g, '(C)');
text = text.replace(/&reg;/g, '(R)');
text = text.replace(/&yen;/g, '\\');
// 初期描画位置を考慮
if (currentLine == 0) {
currentLine += nextLinePosition / 2;
}
//長い文字列を考慮する
var w = 0;
var index = 0;
var fillText = '';
for (var i = 0; i < text.length; i++) {
var metrices = context.measureText(fillText + text.charAt(i), startPosition, currentLine);
// 幅に収まるならバッファに蓄える
if (metrices.width < lineWidth) {
fillText += text.charAt(i);
}
// はみ出す場合
else {
context.fillText(fillText, startPosition, currentLine + margin);
// アンダーライン
if (hasUnderLine) {
context.beginPath();
context.moveTo(0, currentLine + margin);
context.lineTo(lineWidth, currentLine + margin);
context.strokeStyle = context.fillStyle;
context.stroke();
}
currentLine += (nextLinePosition + margin);
fillText = text.charAt(i);
}
}
if (fillText.length > 0) {
context.fillText(fillText, startPosition, currentLine + margin);
// アンダーライン
if (hasUnderLine) {
var x1, x2;
if (textAlign == 'left') {
x1 = 0;
x2 = metrices.width;
} else if (textAlign == 'center') {
x1 = startPosition - (metrices.width / 2);
x2 = startPosition + (metrices.width / 2);
} else if (textAlign = -'right') {
x1 = startPosition;
x2 = startPosition - metrices.width;
}
context.beginPath();
context.moveTo(x1, currentLine + margin);
context.lineTo(x2, currentLine + margin);
context.strokeStyle = context.fillStyle;
context.stroke();
}
currentLine += (nextLinePosition + margin);
}
}
}
);
// 描画したイメージを返却する
var imageUrl = canvas.toDataURL();
return imageUrl;
};
var zoom_ratioPre = 1; eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('0 2=1;0 6=1;0 4;0 a=o;0 c;0 b=u;0 5=-1;0 8=-1;i g(){2=j.2();3(4){r(4);4=q}6=f.e.h/7.d;3(2!=6){3(5==-1){5=f.e.h}3(8==-1){8=f.e.h}3(c){c(2,6,5,8,7.d,7.p)}2=6;j.2(2);5=7.d;8=7.p}3(a==l){4=m("g();",b)}};i t(){a=o};i s(9){a=l;3(9.k){c=9.k}3(9.n){b=9.n}4=m("g();",b)};', 31, 31, 'var||zoom_ratioPre|if|zoom_timer|zoom_oldW|zoom_ratio|window|zoom_oldH|params|zoom_continue|zoom_miliSeconds|zoom_callbackFunction|innerWidth|documentElement|document|calculateZoomLevel|clientWidth|function|ClientData|callbackFunction|true|setTimeout|time|false|innerHeight|null|clearTimeout|startDetectZoom|stopDetectZoom|1000'.split('|'), 0, {}))
var zoom_ratio = 1;
var zoom_timer;
var zoom_continue = false;
var zoom_callbackFunction;
var zoom_miliSeconds = 1000; // Default is 1 second
var zoom_oldW = -1;
var zoom_oldH = -1;
function calculateZoomLevel() {
zoom_ratioPre = ClientData.zoom_ratioPre();
if (zoom_timer) {
clearTimeout(zoom_timer);
zoom_timer = null;
}
zoom_ratio = document.documentElement.clientWidth / window.innerWidth;
if (zoom_ratioPre != zoom_ratio) {
if (zoom_oldW == -1) {
zoom_oldW = document.documentElement.clientWidth;
}
if (zoom_oldH == -1) {
zoom_oldH = document.documentElement.clientWidth;
}
if (zoom_callbackFunction) {
zoom_callbackFunction(zoom_ratioPre, zoom_ratio, zoom_oldW, zoom_oldH, window.innerWidth, window.innerHeight);
}
zoom_ratioPre = zoom_ratio;
ClientData.zoom_ratioPre(zoom_ratioPre);
zoom_oldW = window.innerWidth;
zoom_oldH = window.innerHeight;
}
if (zoom_continue == true) {
zoom_timer = setTimeout("calculateZoomLevel();", zoom_miliSeconds);
}
};
function stopDetectZoom() {
zoom_continue = false;
};
function startDetectZoom(params) {
zoom_continue = true;
if (params.callbackFunction) {
zoom_callbackFunction = params.callbackFunction;
}
if (params.time) {
zoom_miliSeconds = params.time;
}
zoom_timer = setTimeout("calculateZoomLevel();", zoom_miliSeconds);
};
\ No newline at end of file
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"Logout", "dspBkCancel":"Logout",
"txtSearchResult":"Result", "txtSearchResult":"Result",
"dspHome":"Home", "dspHome":"Home",
"txtLoginUser":"(Ver.20130930)User:", "txtLoginUser":"(Ver.20131002)User:",
"txtAll":"All", "txtAll":"All",
"txtMkgSize":"Size", "txtMkgSize":"Size",
"txtMkgS":"S", "txtMkgS":"S",
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト", "dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果", "txtSearchResult":"検索結果",
"dspHome":"ホーム", "dspHome":"ホーム",
"txtLoginUser":"(Ver.20130930)ログイン中:", "txtLoginUser":"(Ver.20131002)ログイン中:",
"txtAll":"すべて", "txtAll":"すべて",
"txtMkgSize":"太さ", "txtMkgSize":"太さ",
"txtMkgS":"小", "txtMkgS":"小",
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃", "dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과", "txtSearchResult":"검색 결과",
"dspHome":"홈", "dspHome":"홈",
"txtLoginUser":"(Ver.20130930)로그인 중:", "txtLoginUser":"(Ver.20131002)로그인 중:",
"txtAll":"전체", "txtAll":"전체",
"txtMkgSize":"두께", "txtMkgSize":"두께",
"txtMkgS":"소", "txtMkgS":"소",
......
 eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('9 H={};d 18(D,q,j){9 F=19(H[D].1a);6(F==1){6($(\'#c\').R<=0){9 3=\'<r 5="W" G="c">\';3+=\'<u 5="4" 4="S">\'+8("S")+\'</u>\';3+=\'<p 5="g"></p>\';3+=\'<p 5="f">\';3+=\'<a 4="s" 5="k 4">\'+8("s")+\'</a>\';3+=\'<a 4="v" 5="x 4">\'+8("v")+\'</a>\';3+=\'</p>\';3+=\'</r>\';$(\'O\').K(3)}$(\'#c .f .x\').A(\'b\').b(d(){6(j!=1){w()}$(\'#c\').h()});N();$(\'#c .g\').3(H[D].15);$(\'#c\').m().J();$(\'#c .f .k\').A(\'b\').b(d(){6(j!=1){w()}$(\'#c\').h();q()})}B 6(F==2){6($(\'#7\').R<=0){9 3=\'<r 5="W" G="7">\';3+=\'<u 5="4" 4="11">\'+8("11")+\'</u>\';3+=\'<p 5="g">\';3+=\'<t 5="16 4" 4="X">\'+8("X")+\'</t>\';3+=\'<n 17="i" />\';3+=\'<t 5="14" G="l"></t>\';3+=\'</p>\';3+=\'<p 5="f">\';3+=\'<a 4="s" 5="k 4">\'+8("s")+\'</a>\';3+=\'<a 4="v" 5="x 4">\'+8("v")+\'</a>\';3+=\'</p>\';3+=\'</r>\';$(\'O\').K(3);$(\'#7 .g n\').12(d(e){9 L=(e.I?e.I:e.1r);6(L==13){$(\'#7 .f .k\').b()}})}$(\'#7 .f .x\').A(\'b\').b(d(){6(j!=1){w()}$(\'#7\').h()});N();$(\'#7 .g n\').M(\'\');$(\'#l\').h();$(\'#7\').m().J();$(\'#7 .f .k\').A(\'b\').b(d(){9 i=$(\'#7 .g n\').M();6(!1s.1t(i)){$(\'#l\').3(8(\'1q\')).m();1x}9 10={1y:o.Q(),1v:o.1w(),i:i,1u:o.1o()};9 Y=1e();9 C=Y.C;1p(C,1g,\'1b\',\'1c\',10,d(y){6(y.1d==\'1h\'){o.Q(y.1l);6(j!=1){w()}$(\'#7\').h();q()}B{$(\'#l\').3(V(8(\'P\'),y.U).Z()).m()}},d(z,1m,1n){9 E=\'1i\';6(z.T&&z.1j!=0){E=1k.1f(z.T).U}$(\'#l\').3(V(8(\'P\'),E).Z()).m()})})}B{q()}};', 62, 97, '|||html|lang|class|if|limit_level2|i18nText|var||click|limit_level1|function||deletebtn|message|hide|password|isNotUnlockScreen|ok|lblMessageLimitError|show|input|ClientData||func|section|dspOK|label|h1|dspCancel|unlockLayout|cancel|data|xhr|unbind|else|apiLoginUrl|contentId|errorCode|levelContent|id|messageLevel|keyCode|center|append|code|val|lockLayout|body|msgLoginErrWrong|userInfo_sid|length|txtContentWarning|responseText|errorMessage|format|sectionLimitAccess|txtContentPWMsg|sysSettings|toString|params|txtContentPWTitle|keydown||error|alertMessage|text|type|checkLimitContent|parseInt|alertMessageLevel|webClientLogin|GET|result|avwSysSetting|parse|null|success|E001|status|JSON|sid|statusText|errorThrown|userInfo_accountPath|avwCmsApiSyncWithUrl|msgPwdEmpty|which|ValidationUtil|CheckRequiredForText|urlpath|loginId|userInfo_loginId_session|return|previousSid'.split('|'), 0, {}))
var messageLevel = {};
function checkLimitContent(contentId, func,isNotUnlockScreen) {
var levelContent = parseInt(messageLevel[contentId].alertMessageLevel);
if (levelContent == 1) {
if ($('#limit_level1').length <= 0) {
var html = '<section class="sectionLimitAccess" id="limit_level1">';
html += '<h1 class="lang" lang="txtContentWarning">' + i18nText("txtContentWarning") + '</h1>';
html += '<p class="message"></p>';
html += '<p class="deletebtn">';
html += '<a lang="dspOK" class="ok lang">' + i18nText("dspOK") + '</a>';
html += '<a lang="dspCancel" class="cancel lang">' + i18nText("dspCancel") + '</a>';
html += '</p>';
html += '</section>';
$('body').append(html);
}
$('#limit_level1 .deletebtn .cancel').unbind('click').click(
function () {
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level1').hide();
}
);
lockLayout();
$('#limit_level1 .message').html(messageLevel[contentId].alertMessage);
$('#limit_level1').show().center();
$('#limit_level1 .deletebtn .ok').unbind('click').click(
function () {
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level1').hide();
func();
}
);
}
else if (levelContent == 2) {
if ($('#limit_level2').length <= 0) {
var html = '<section class="sectionLimitAccess" id="limit_level2">';
html += '<h1 class="lang" lang="txtContentPWTitle">' + i18nText("txtContentPWTitle") + '</h1>';
html += '<p class="message">';
html += '<label class="text lang" lang="txtContentPWMsg">' + i18nText("txtContentPWMsg") + '</label>';
html += '<input type="password" />';
html += '<label class="error" id="lblMessageLimitError"></label>';
html += '</p>';
html += '<p class="deletebtn">';
html += '<a lang="dspOK" class="ok lang">' + i18nText("dspOK") + '</a>';
html += '<a lang="dspCancel" class="cancel lang">' + i18nText("dspCancel") + '</a>';
html += '</p>';
html += '</section>';
$('body').append(html);
// press enter at input password
$('#limit_level2 .message input').keydown(
function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { //Enter keycode
$('#limit_level2 .deletebtn .ok').click();
}
}
);
}
$('#limit_level2 .deletebtn .cancel').unbind('click').click(
function () {
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level2').hide();
}
);
// lock layout
lockLayout();
//reset input password
$('#limit_level2 .message input').val('');
// hide error message
$('#lblMessageLimitError').hide();
// show dialog
$('#limit_level2').show().center();
$('#limit_level2 .deletebtn .ok').unbind('click').click(
function () {
var password = $('#limit_level2 .message input').val();
if (!ValidationUtil.CheckRequiredForText(password)) {
$('#lblMessageLimitError').html(i18nText('msgPwdEmpty')).show();
return;
}
// start login
var params = {
previousSid: ClientData.userInfo_sid(),
loginId: ClientData.userInfo_loginId_session(),
password: password,
urlpath: ClientData.userInfo_accountPath()
};
// Get url to login
var sysSettings = avwSysSetting();
var apiLoginUrl = sysSettings.apiLoginUrl;
avwCmsApiSyncWithUrl(apiLoginUrl, null, 'webClientLogin', 'GET', params,
function (data) {
if (data.result == 'success') {
// update sid id
ClientData.userInfo_sid(data.sid);
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level2').hide();
// open content
func();
}
else {
$('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), data.errorMessage).toString()).show();
}
},
function (xhr, statusText, errorThrown) {
var errorCode = 'E001';
if (xhr.responseText && xhr.status != 0) {
errorCode = JSON.parse(xhr.responseText).errorMessage;
}
$('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), errorCode).toString()).show();
});
}
);
}
else // content level 0 or null
{
func();
}
};
\ No newline at end of file
...@@ -66,9 +66,9 @@ function getPageSizeByPageNo(pageNo){ ...@@ -66,9 +66,9 @@ function getPageSizeByPageNo(pageNo){
for(var i = 0; i < contentPageSizeArr.length; i++){ for(var i = 0; i < contentPageSizeArr.length; i++){
var page = contentPageSizeArr[i]; var page = contentPageSizeArr[i];
if(page.pageNo == pageNo){ if(page.pageNo == pageNo){
widthContentImage = page.pageWidth; widthContentImage = page.pageWidth;
heightContentImage = page.pageHeight; heightContentImage = page.pageHeight;
} }
} }
}; };
......
...@@ -1437,7 +1437,17 @@ Transition.prototype.flipToPage = function (index) { ...@@ -1437,7 +1437,17 @@ Transition.prototype.flipToPage = function (index) {
}); });
//change pageIndex and image bookmark //change pageIndex and image bookmark
userScale = 1; userScale = 1;
changeScale(userScale); //START TRB00097
//changeScale(userScale);
srcRect = new Rect(0, 0, 0, 0);
srcRectNext = new Rect(0, 0, 0, 0);
srcRectPrev = new Rect(0, 0, 0, 0);
destRect = new Rect(0, 0, 0, 0);
destRectNext = new Rect(0, 0, 0, 0);
destRectPrev = new Rect(0, 0, 0, 0);
//END TRB00097
checkDisableButtonZoom(); checkDisableButtonZoom();
getContent().toPage(index); getContent().toPage(index);
...@@ -1497,7 +1507,17 @@ Transition.prototype.flipToPage = function (index) { ...@@ -1497,7 +1507,17 @@ Transition.prototype.flipToPage = function (index) {
}); });
//change pageIndex and image bookmark //change pageIndex and image bookmark
userScale = 1; userScale = 1;
changeScale(userScale); //START TRB00097
//changeScale(userScale);
srcRect = new Rect(0, 0, 0, 0);
srcRectNext = new Rect(0, 0, 0, 0);
srcRectPrev = new Rect(0, 0, 0, 0);
destRect = new Rect(0, 0, 0, 0);
destRectNext = new Rect(0, 0, 0, 0);
destRectPrev = new Rect(0, 0, 0, 0);
//END TRB00097
checkDisableButtonZoom(); checkDisableButtonZoom();
getContent().toPage(index); getContent().toPage(index);
......
...@@ -369,7 +369,11 @@ function firstPage_click() { ...@@ -369,7 +369,11 @@ function firstPage_click() {
$('#divImageLoading').css('display', 'none'); $('#divImageLoading').css('display', 'none');
changeScale(userScale); //START TRB00097
//userScale = 1;
//changeScale(userScale);
//END TRB00097
checkDisableButtonZoom(); checkDisableButtonZoom();
var tran = new Transition(); var tran = new Transition();
tran.flipToPage(0); tran.flipToPage(0);
...@@ -385,8 +389,12 @@ function firstPage_click() { ...@@ -385,8 +389,12 @@ function firstPage_click() {
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects); getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none'); $('#divImageLoading').css('display', 'none');
//START TRB00097
//START TRB00097
//userScale = 1;
changeScale(userScale); //changeScale(userScale);
//END TRB00097
checkDisableButtonZoom(); checkDisableButtonZoom();
var tran = new Transition(); var tran = new Transition();
tran.flipToPage(0); tran.flipToPage(0);
...@@ -614,8 +622,78 @@ $(document).keyup(function (e) { ...@@ -614,8 +622,78 @@ $(document).keyup(function (e) {
}); });
//END TRB00049 - Editor: Long - Date: 09/26/2013 - Summary : Add short key alt //END TRB00049 - Editor: Long - Date: 09/26/2013 - Summary : Add short key alt
//START TRB - Editor : Long -Date : 10/01/2013 - Summary : Re Assign sid for image 3d
function update3DImagesArr(){
if(_object3DImageArr.length > 0){
var temp3DArr = [];
_object3DImageArr = [];
for(var i = 0; i < _object3DImageArr; i++){
var object3D = _object3DImageArr[i];
var temp3dview = object3d["3dview"];
var tempCurrX = object3d["_currFrameX"];
var tempCurrY = object3d["_currFrameY"];
var tempLastSelectedFrame = object3d["lastSelectedFrame"];
var tempActionType = object3d["actionType"];
var tempHeight = object3d["height"];
var tempHorizonCnt = object3d["horizonCount"];
var tempId = object3d["id"];
var tempInitImage = object3d["initImage"];
var tempMediaType = object3d["mediaType"];
var tempVerticalCnt = object3d["verticalCount"];
var tempVisible = object3d["visible"];
var tempWidth = object3d["width"];
var tempX = object3d["x"];
var tempY = object3d["y"];
tempInitImage = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + getUrlParams(tempInitImage, 'resourceId');
for(var j = 0; j< temp3dview.length; j++){
var url = temp3dview[j];
var id = getUrlParamByUrl(url, 'resourceId');
temp3dview[j] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + id;
}
var arr3D = [];
arr3D["3dview"] = temp3dview;
arr3D["_currFrameX"] = tempCurrX;
arr3D["_currFrameY"] = tempCurrY;
arr3D["lastSelectedFrame"] = tempLastSelectedFrame;
arr3D["actionType"] = tempActionType;
arr3D["height"] = tempHeight;
arr3D["horizonCount"] = tempHorizonCnt;
arr3D["id"] = tempId;
arr3D["initImage"] = tempInitImage;
arr3D["mediaType"] = tempMediaType;
arr3D["verticalCount"] = tempVerticalCnt;
arr3D["visible"] = tempVisible;
arr3D["width"] = tempWidth;
arr3D["x"] = tempX;
arr3D["y"] = tempY;
temp3DArr.push(arr3D);
}
_object3DImageArr = temp3DArr;
}
};
//Get param url
function getUrlParamByUrl(url, name){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec(url);
if( results == null ){
return "";
}
else{
return results[1];
}
};
//END TRB - Editor : Long -Date : 10/01/2013 - Summary : Re Assign sid for image 3d
function onUnlock() { function onUnlock() {
removeObject(); removeObject();
update3DImagesArr();
getPageObjectsByPageIndex(pageObjectsData, 0); getPageObjectsByPageIndex(pageObjectsData, 0);
/* handle play BGM of content jump */ /* handle play BGM of content jump */
for (var nIndex = 0; nIndex < pageObjects.length; nIndex++) { for (var nIndex = 0; nIndex < pageObjects.length; nIndex++) {
...@@ -806,14 +884,22 @@ function onClick_CanvasMain(event) { ...@@ -806,14 +884,22 @@ function onClick_CanvasMain(event) {
//Start : TRB00005, TRB00006 - Editor : Long - Date: 08/28/2013 - Summary : Prevent click when transit //Start : TRB00005, TRB00006 - Editor : Long - Date: 08/28/2013 - Summary : Prevent click when transit
if (event.pageX > 0 && event.pageX < 300) { if (event.pageX > 0 && event.pageX < 300) {
if(!isPreventClick){ if(!isPreventClick){
prevPage_click(); //START TRB00097
if(userScale == 1){
prevPage_click();
}
//END TRB00097
} }
else{ else{
isPreventClick = false; isPreventClick = false;
} }
} else if (event.pageX > (cwMain - 300) && event.pageX < cwMain) { } else if (event.pageX > (cwMain - 300) && event.pageX < cwMain) {
if(!isPreventClick){ if(!isPreventClick){
nextPage_click(); //START TRB00097
if(userScale == 1){
nextPage_click();
}
//END TRB00097
} }
else{ else{
isPreventClick = false; isPreventClick = false;
...@@ -876,7 +962,9 @@ function mouseMove_canvasMain(event) { ...@@ -876,7 +962,9 @@ function mouseMove_canvasMain(event) {
/* base image move when userScale over 1 */ /* base image move when userScale over 1 */
if (moveFlag && userScale != 1) { if (moveFlag && userScale != 1) {
$('#main').css('cursor', 'pointer'); $('#main').css('cursor', 'pointer');
//START TRB00097
cancelClick = true;
//END TRB00097
var mx; var mx;
var my; var my;
// calc mouse moving distance // calc mouse moving distance
...@@ -1528,7 +1616,9 @@ function onTouchmove(evt){ ...@@ -1528,7 +1616,9 @@ function onTouchmove(evt){
//when change from zoom mode //when change from zoom mode
if(userScale != 1){ if(userScale != 1){
_isPageNaviTouch = false; _isPageNaviTouch = false;
//START TRB00097
cancelClick = true;
//END TRB00097
$('#main').css('cursor', 'pointer'); $('#main').css('cursor', 'pointer');
var mx; var mx;
...@@ -2043,11 +2133,15 @@ function processZoomPage(touch1, touch2){ ...@@ -2043,11 +2133,15 @@ function processZoomPage(touch1, touch2){
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming //Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){ if(getPageIndex() < totalPage - 1){
flip(1); //START TRB00097
//flip(1);
//END TRB00097
} }
if(getPageIndex() > 0){ if(getPageIndex() > 0){
flip(2); //START TRB00097
//flip(2);
//END TRB00097
} }
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming //End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
...@@ -2067,11 +2161,15 @@ function processZoomPage(touch1, touch2){ ...@@ -2067,11 +2161,15 @@ function processZoomPage(touch1, touch2){
flip(); flip();
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming //Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){ if(getPageIndex() < totalPage - 1){
flip(1); //START TRB00097
//flip(1);
//END TRB00097
} }
if(getPageIndex() > 0){ if(getPageIndex() > 0){
flip(2); //START TRB00097
//flip(2);
//END TRB00097
} }
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming //End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
/* zoom video */ /* zoom video */
......
...@@ -95,6 +95,10 @@ var resourceImage = new Image(); ...@@ -95,6 +95,10 @@ var resourceImage = new Image();
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
//Array of pages size //Array of pages size
var contentPageSizeArr = []; var contentPageSizeArr = [];
var widthEachNextPage = 0;
var heightEachNextPage = 0;
var widthEachPrevPage = 0;
var heightEachPrevPage = 0;
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
/* zoom video */ /* zoom video */
......
...@@ -1359,6 +1359,24 @@ function switchCanvas(nav){ ...@@ -1359,6 +1359,24 @@ function switchCanvas(nav){
$('#offscreen').attr("id","offscreenPre"); $('#offscreen').attr("id","offscreenPre");
$('#offscreenNext').attr("id","offscreen"); $('#offscreenNext').attr("id","offscreen");
$('#mainPreBK').attr("id","offscreenNext"); $('#mainPreBK').attr("id","offscreenNext");
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
widthEachPrevPage = widthEachPage;
widthEachPage = widthEachNextPage;
heightEachPrevPage = heightEachPage;
heightEachPage = heightEachNextPage;
srcRectPrev = srcRect;
srcRect = srcRectNext;
destRectPrev = destRect;
destRect = destRectNext;
userScale = 1;
changeScale(userScale);
flip();
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
} }
else{ else{
// change div id // change div id
...@@ -1371,6 +1389,25 @@ function switchCanvas(nav){ ...@@ -1371,6 +1389,25 @@ function switchCanvas(nav){
$('#offscreen').attr("id","offscreenNext"); $('#offscreen').attr("id","offscreenNext");
$('#offscreenPre').attr("id","offscreen"); $('#offscreenPre').attr("id","offscreen");
$('#mainNextBK').attr("id","offscreenPre"); $('#mainNextBK').attr("id","offscreenPre");
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
widthEachNextPage = widthEachPage;
widthEachPage = widthEachPrevPage;
heightEachNextPage = heightEachPage;
heightEachPage = heightEachPrevPage;
srcRectNext = srcRect;
srcRect = srcRectPrev;
destRectNext = destRect;
destRect = destRectPrev;
userScale = 1;
changeScale(userScale);
flip();
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
} }
}; };
...@@ -1397,6 +1434,7 @@ function assignCurrentContentPage(nav){ ...@@ -1397,6 +1434,7 @@ function assignCurrentContentPage(nav){
prevPageObjects = pageObjects; prevPageObjects = pageObjects;
pageObjects = nextPageObjects; pageObjects = nextPageObjects;
} }
else{ else{
nextPageImage = pageImages; nextPageImage = pageImages;
...@@ -1416,6 +1454,7 @@ function assignCurrentContentPage(nav){ ...@@ -1416,6 +1454,7 @@ function assignCurrentContentPage(nav){
nextPageObjects = pageObjects; nextPageObjects = pageObjects;
pageObjects = prevPageObjects; pageObjects = prevPageObjects;
} }
}; };
......
...@@ -34,78 +34,94 @@ function dlgMarking_dspSave_click() { ...@@ -34,78 +34,94 @@ function dlgMarking_dspSave_click() {
var img = new Image(); var img = new Image();
img.onload = function () { img.onload = function () {
//TRB00098
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height); context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height);
//TRB00098
/*create new entity marking */
var marking = new MarkingEntity();
marking.contentid = contentID;
if(contentType == ContentTypeKeys.Type_Image){
marking.pageNo = 1;
}else{
marking.pageNo = changePageIndex(getPageIndex());
}
marking.content = canvas_draw.toDataURL("image/png"); //START TRB00098
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new marking/maker. var saveImg = new Image();
marking.markingid = getUUID(); var saveImgUrl = canvas_draw.toDataURL("image/png");
marking.registerDate = new Date();
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new marking/maker. saveImg.onload = function(){
/* insert marking */ /*create new entity marking */
var arr = ClientData.MarkingData(); var marking = new MarkingEntity();
var nIndexMarking = -1; marking.contentid = contentID;
if(contentType == ContentTypeKeys.Type_Image){
for (var nIndex = 0; nIndex < arr.length; nIndex++) { marking.pageNo = 1;
if (arr[nIndex].contentid == contentID }else{
&& arr[nIndex].pageNo == changePageIndex(getPageIndex())) { marking.pageNo = changePageIndex(getPageIndex());
nIndexMarking = nIndex; }
break; var saveCanvas = document.createElement('canvas');
} saveCanvas.width = canvas_offscreen.width;
} saveCanvas.height = canvas_offscreen.height;
var saveContext = saveCanvas.getContext('2d');
if (isDrawing == true) {/* if has draw image */ saveContext.drawImage(saveImg, 0, 0, saveCanvas.width, saveCanvas.height);
if (isClearDrawing == true) {
arr.splice(nIndexMarking, 1); marking.content = saveCanvas.toDataURL("image/png");
} else { //END TRB00098
/* case not exist marking */ //=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new marking/maker.
if (nIndexMarking == -1) { marking.markingid = getUUID();
arr.push(marking); marking.registerDate = new Date();
} else { //=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new marking/maker.
/* case exist marking */ /* insert marking */
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker. var arr = ClientData.MarkingData();
var editedMarkingEntity = arr[nIndexMarking]; var nIndexMarking = -1;
editedMarkingEntity.content = canvas_draw.toDataURL("image/png");
editedMarkingEntity.registerDate = new Date(); for (var nIndex = 0; nIndex < arr.length; nIndex++) {
if (arr[nIndex].contentid == contentID
arr[nIndexMarking] = editedMarkingEntity; && arr[nIndex].pageNo == changePageIndex(getPageIndex())) {
//arr[nIndexMarking] = marking; nIndexMarking = nIndex;
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker. break;
} }
} }
}
if (isDrawing == true) {/* if has draw image */
/*add marking to local storage */ if (isClearDrawing == true) {
ClientData.MarkingData(arr); arr.splice(nIndexMarking, 1);
} else {
// Close dialog /* case not exist marking */
//$("#dlgMarking").dialog('close'); if (nIndexMarking == -1) {
$("#dlgMarking").hide(); arr.push(marking);
ClientData.IsAddingMarking(false); } else {
$('#draw_canvas').css('display', 'none'); /* case exist marking */
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker.
/*set flag change marking */ var editedMarkingEntity = arr[nIndexMarking];
ClientData.isChangedMarkingData(true); editedMarkingEntity.content = canvas_draw.toDataURL("image/png");
editedMarkingEntity.registerDate = new Date();
ClientData.IsHideToolbar(false);
arr[nIndexMarking] = editedMarkingEntity;
/* draw again*/ //arr[nIndexMarking] = marking;
//drawCanvas(); //=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker.
//disableAllControl(); }
handleDisplayToolbar(); }
/* visible button fullscreen */ }
//$('#control_screen_2').show();
/*add marking to local storage */
/* init clear drawing canvas */ ClientData.MarkingData(arr);
isClearDrawing = false;
// Close dialog
//$("#dlgMarking").dialog('close');
$("#dlgMarking").hide();
ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display', 'none');
/*set flag change marking */
ClientData.isChangedMarkingData(true);
ClientData.IsHideToolbar(false);
/* draw again*/
//drawCanvas();
//disableAllControl();
handleDisplayToolbar();
/* visible button fullscreen */
//$('#control_screen_2').show();
/* init clear drawing canvas */
isClearDrawing = false;
};
saveImg.src = saveImgUrl;
}; };
img.src = imgMarkerTemp; img.src = imgMarkerTemp;
......
...@@ -136,8 +136,20 @@ function AddMemo(contentId,pageNo,targetId, posX, posY, callback) { ...@@ -136,8 +136,20 @@ function AddMemo(contentId,pageNo,targetId, posX, posY, callback) {
$("#overlay").show(); $("#overlay").show();
disableControlsCopyMemo(); disableControlsCopyMemo();
targetDiv.css('z-index','1005'); targetDiv.css('z-index','1005');
targetDiv.css('top',targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 )); //START TRB00097
if(targetY >= $('#wrapper').height()/2){
targetDiv.css('top', $('#wrapper').height()/3);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
}
else{
targetDiv.css('top',targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
}
//END TRB00097
targetDiv.draggable({ handle: "h1" }); targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog(); //editJqueryUIDialog();
...@@ -163,8 +175,17 @@ function EditMemo(index, posXPlus, posYPlus, targetId, callback){ ...@@ -163,8 +175,17 @@ function EditMemo(index, posXPlus, posYPlus, targetId, callback){
targetDiv.css('z-index','1005'); targetDiv.css('z-index','1005');
var pt = imageToScreen(targetX, targetY); var pt = imageToScreen(targetX, targetY);
targetDiv.css('top',pt.y);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 )); //START TRB00097
if(pt.y >= $('#wrapper').height()/2){
targetDiv.css('top', $('#wrapper').height()/3);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
}
else{
targetDiv.css('top',pt.y);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
}
//END TRB00097
targetDiv.draggable({ handle: "h1" }); targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog(); //editJqueryUIDialog();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment