Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
공백 변경 숨기기
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
텍스트 스타일
모양 변경
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled diff
생성일
11년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
0 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
204 행
복사
1 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
205 행
복사
/**
/**
* Plugin: jquery.zGlossary
* Plugin: jquery.zGlossary
*
*
* Version: 1.0.2
* Version: 1.0.2
* (c) Copyright 2011-2013, Zazar Ltd
* (c) Copyright 2011-2013, Zazar Ltd
*
*
* Description: jQuery plugin to find and display term definitions in HTML text
* Description: jQuery plugin to find and display term definitions in HTML text
*
*
* History:
* History:
* 1.0.2 - Added show once option
* 1.0.2 - Added show once option
* 1.0.1 - Correct mistype to _addTerm function (Thanks Aldopaolo)
* 1.0.1 - Correct mistype to _addTerm function (Thanks Aldopaolo)
* 1.0.0 - Initial release
* 1.0.0 - Initial release
*
*
**/
**/
(function($){
(function($){
$.fn.glossary = function(url, options) {
$.fn.glossary = function(url, options) {
// Set plugin defaults
// Set plugin defaults
var defaults = {
var defaults = {
ignorecase: false,
ignorecase: false,
tiptag: 'h6',
tiptag: 'h6',
excludetags: [],
excludetags: [],
linktarget: '_blank',
linktarget: '_blank',
showonce: false
showonce: false
};
};
var options = $.extend(defaults, options);
var options = $.extend(defaults, options);
var id = 1;
var id = 1;
// Functions
// Functions
return this.each(function(i, e) {
return this.each(function(i, e) {
// Ensure any exclude tags are uppercase for comparisons
// Ensure any exclude tags are uppercase for comparisons
$.each(options.excludetags, function(i,e) { options.excludetags[i] = e.toUpperCase(); });
$.each(options.excludetags, function(i,e) { options.excludetags[i] = e.toUpperCase(); });
// Function to find and add term
// Function to find and add term
var _addTerm = function(e, term, type, def) {
var _addTerm = function(e, term, type, def) {
var patfmt = term;
var patfmt = term;
var skip = 0;
var skip = 0;
// Check the element is a text node
// Check the element is a text node
if (e.nodeType == 3) {
if (e.nodeType == 3) {
// Case insensistive matching option
// Case insensistive matching option
if (options.ignorecase) {
if (options.ignorecase) {
var pos = e.data.toLowerCase().indexOf(patfmt.toLowerCase());
var pos = e.data.toLowerCase().indexOf(patfmt.toLowerCase());
} else {
} else {
var pos = e.data.indexOf(patfmt);
var pos = e.data.indexOf(patfmt);
}
}
// Check if the term is found
// Check if the term is found
if (pos >= 0) {
if (pos >= 0) {
// Check for excluded tags
// Check for excluded tags
if (jQuery.inArray($(e).parent().get(0).tagName,options.excludetags) > -1) {
if (jQuery.inArray($(e).parent().get(0).tagName,options.excludetags) > -1) {
} else {
} else {
// Create link element
// Create link element
var spannode = document.createElement('a');
var spannode = document.createElement('a');
spannode.className = 'glossaryTerm';
spannode.className = 'glossaryTerm';
if (type == '0') {
if (type == '0') {
// Popup definition
// Popup definition
spannode.id = "glossaryID" + id;
spannode.id = "glossaryID" + id;
spannode.href = '#';
spannode.href = '#';
spannode.title = 'Click for \''+ term +'\' definition';
spannode.title = 'Click for \''+ term +'\' definition';
spannode.className = 'glossaryTerm';
spannode.className = 'glossaryTerm';
$(spannode).click(function(e) {
$(spannode).click(function(e) {
$.glossaryTip('<'+ options.tiptag +'>'+ term + '</'+ options.tiptag +'><p>'+ def +'</p>', {mouse_event: e})
$.glossaryTip('<'+ options.tiptag +'>'+ term + '</'+ options.tiptag +'><p>'+ def +'</p>', {mouse_event: e})
return false;
return false;
});
});
} else if (type == '1') {
} else if (type == '1') {
// Wikipedia definition
// Wikipedia definition
spannode.title = 'Click to look up \''+ term+'\' in Wikipedia';
spannode.title = 'Click to look up \''+ term+'\' in Wikipedia';
term = term.replace(/ /g, "_");
term = term.replace(/ /g, "_");
spannode.href = 'http://en.wikipedia.org/wiki/'+term;
spannode.href = 'http://en.wikipedia.org/wiki/'+term;
spannode.target = options.linktarget;
spannode.target = options.linktarget;
} else if (type == '2') {
} else if (type == '2') {
// Google search
// Google search
spannode.title = 'Click to search for \''+ term +'\' in Google';
spannode.title = 'Click to search for \''+ term +'\' in Google';
term = term.replace(/ /g, "+");
term = term.replace(/ /g, "+");
spannode.href = 'http://www.google.co.uk/search?q='+term;
spannode.href = 'http://www.google.co.uk/search?q='+term;
spannode.target = options.linktarget;
spannode.target = options.linktarget;
} else if (type == '3') {
} else if (type == '3') {
// Custom external link
// Custom external link
spannode.title = 'Click to view \''+ term +'\' definition';
spannode.title = 'Click to view \''+ term +'\' definition';
spannode.href = def;
spannode.href = def;
spannode.target = options.linktarget;
spannode.target = options.linktarget;
}
}
var middlebit = e.splitText(pos);
var middlebit = e.splitText(pos);
var endbit = middlebit.splitText(patfmt.length);
var endbit = middlebit.splitText(patfmt.length);
var middleclone = middlebit.cloneNode(true);
var middleclone = middlebit.cloneNode(true);
spannode.appendChild(middleclone);
spannode.appendChild(middleclone);
middlebit.parentNode.replaceChild(spannode, middlebit);
middlebit.parentNode.replaceChild(spannode, middlebit);
skip = 1;
skip = 1;
id += 1;
id += 1;
}
}
}
}
}
}
else if (e.nodeType == 1 && e.childNodes && !/(script|style)/i.test(e.tagName)) {
else if (e.nodeType == 1 && e.childNodes && !/(script|style)/i.test(e.tagName)) {
// Search child nodes
// Search child nodes
for (var i = 0; i < e.childNodes.length; ++i) {
for (var i = 0; i < e.childNodes.length; ++i) {
var ret = _addTerm(e.childNodes[i], term, type, def);
var ret = _addTerm(e.childNodes[i], term, type, def);
// If term found and show once option go to next term
// If term found and show once option go to next term
if (options.showonce && ret == 1) {
if (options.showonce && ret == 1) {
i = e.childNodes.length;
i = e.childNodes.length;
skip = 1;
skip = 1;
} else {
} else {
i += ret;
i += ret;
}
}
}
}
}
}
return skip;
return skip;
};
};
// Get glossary list items
// Get glossary list items
$.ajax({
$.ajax({
type: 'GET',
type: 'GET',
url: url,
url: url,
dataType: 'json',
dataType: 'json',
success: function(data) {
success: function(data) {
if (data) {
if (data) {
var count = data.length;
var count = data.length;
for (var i=0; i<count; i++) {
for (var i=0; i<count; i++) {
// Find term in text
// Find term in text
var item = data[i];
var item = data[i];
_addTerm(e, item.term, item.type, item.definition);
_addTerm(e, item.term, item.type, item.definition);
}
}
}
}
복사
복사됨
복사
복사됨
typeof options.callback == 'function' && options.callback();
},
},
error: function() {}
error: function() {}
});
});
});
});
};
};
// Glossary tip popup
// Glossary tip popup
var glossaryTip = function() {}
var glossaryTip = function() {}
$.extend(glossaryTip.prototype, {
$.extend(glossaryTip.prototype, {
setup: function(){
setup: function(){
if ($('#glossaryTip').length) {
if ($('#glossaryTip').length) {
$('#glossaryTip').remove();
$('#glossaryTip').remove();
}
}
glossaryTip.holder = $('<div id="glossaryTip" style="max-width:260px;"><div id="glossaryClose"></div></div>');
glossaryTip.holder = $('<div id="glossaryTip" style="max-width:260px;"><div id="glossaryClose"></div></div>');
glossaryTip.content = $('<div id="glossaryContent"></div>');
glossaryTip.content = $('<div id="glossaryContent"></div>');
$('body').append(glossaryTip.holder.append(glossaryTip.content));
$('body').append(glossaryTip.holder.append(glossaryTip.content));
},
},
show: function(content, event){
show: function(content, event){
glossaryTip.content.html(content);
glossaryTip.content.html(content);
// Display tip at mouse cursor
// Display tip at mouse cursor
var x = parseInt(event.mouse_event.pageX) + 15
var x = parseInt(event.mouse_event.pageX) + 15
var y = parseInt(event.mouse_event.pageY) + 5
var y = parseInt(event.mouse_event.pageY) + 5
glossaryTip.holder.css({top: y, left: x});
glossaryTip.holder.css({top: y, left: x});
// Display the tip
// Display the tip
if (glossaryTip.holder.is(':hidden')) {
if (glossaryTip.holder.is(':hidden')) {
glossaryTip.holder.show();
glossaryTip.holder.show();
}
}
// Add click handler to close
// Add click handler to close
glossaryTip.holder.bind('click', function(){
glossaryTip.holder.bind('click', function(){
glossaryTip.holder.stop(true).fadeOut(200);
glossaryTip.holder.stop(true).fadeOut(200);
return false;
return false;
});
});
}
}
});
});
$.glossaryTip = function(content, event) {
$.glossaryTip = function(content, event) {
var tip = $.glossaryTip.instance;
var tip = $.glossaryTip.instance;
if (!tip) { tip = $.glossaryTip.instance = new glossaryTip(); }
if (!tip) { tip = $.glossaryTip.instance = new glossaryTip(); }
tip.setup();
tip.setup();
tip.show(content, event);
tip.show(content, event);
return tip;
return tip;
}
}
})(jQuery);
})(jQuery);
저장된 비교 결과
원본
파일 열기
/** * Plugin: jquery.zGlossary * * Version: 1.0.2 * (c) Copyright 2011-2013, Zazar Ltd * * Description: jQuery plugin to find and display term definitions in HTML text * * History: * 1.0.2 - Added show once option * 1.0.1 - Correct mistype to _addTerm function (Thanks Aldopaolo) * 1.0.0 - Initial release * **/ (function($){ $.fn.glossary = function(url, options) { // Set plugin defaults var defaults = { ignorecase: false, tiptag: 'h6', excludetags: [], linktarget: '_blank', showonce: false }; var options = $.extend(defaults, options); var id = 1; // Functions return this.each(function(i, e) { // Ensure any exclude tags are uppercase for comparisons $.each(options.excludetags, function(i,e) { options.excludetags[i] = e.toUpperCase(); }); // Function to find and add term var _addTerm = function(e, term, type, def) { var patfmt = term; var skip = 0; // Check the element is a text node if (e.nodeType == 3) { // Case insensistive matching option if (options.ignorecase) { var pos = e.data.toLowerCase().indexOf(patfmt.toLowerCase()); } else { var pos = e.data.indexOf(patfmt); } // Check if the term is found if (pos >= 0) { // Check for excluded tags if (jQuery.inArray($(e).parent().get(0).tagName,options.excludetags) > -1) { } else { // Create link element var spannode = document.createElement('a'); spannode.className = 'glossaryTerm'; if (type == '0') { // Popup definition spannode.id = "glossaryID" + id; spannode.href = '#'; spannode.title = 'Click for \''+ term +'\' definition'; spannode.className = 'glossaryTerm'; $(spannode).click(function(e) { $.glossaryTip('<'+ options.tiptag +'>'+ term + '</'+ options.tiptag +'><p>'+ def +'</p>', {mouse_event: e}) return false; }); } else if (type == '1') { // Wikipedia definition spannode.title = 'Click to look up \''+ term+'\' in Wikipedia'; term = term.replace(/ /g, "_"); spannode.href = 'http://en.wikipedia.org/wiki/'+term; spannode.target = options.linktarget; } else if (type == '2') { // Google search spannode.title = 'Click to search for \''+ term +'\' in Google'; term = term.replace(/ /g, "+"); spannode.href = 'http://www.google.co.uk/search?q='+term; spannode.target = options.linktarget; } else if (type == '3') { // Custom external link spannode.title = 'Click to view \''+ term +'\' definition'; spannode.href = def; spannode.target = options.linktarget; } var middlebit = e.splitText(pos); var endbit = middlebit.splitText(patfmt.length); var middleclone = middlebit.cloneNode(true); spannode.appendChild(middleclone); middlebit.parentNode.replaceChild(spannode, middlebit); skip = 1; id += 1; } } } else if (e.nodeType == 1 && e.childNodes && !/(script|style)/i.test(e.tagName)) { // Search child nodes for (var i = 0; i < e.childNodes.length; ++i) { var ret = _addTerm(e.childNodes[i], term, type, def); // If term found and show once option go to next term if (options.showonce && ret == 1) { i = e.childNodes.length; skip = 1; } else { i += ret; } } } return skip; }; // Get glossary list items $.ajax({ type: 'GET', url: url, dataType: 'json', success: function(data) { if (data) { var count = data.length; for (var i=0; i<count; i++) { // Find term in text var item = data[i]; _addTerm(e, item.term, item.type, item.definition); } } }, error: function() {} }); }); }; // Glossary tip popup var glossaryTip = function() {} $.extend(glossaryTip.prototype, { setup: function(){ if ($('#glossaryTip').length) { $('#glossaryTip').remove(); } glossaryTip.holder = $('<div id="glossaryTip" style="max-width:260px;"><div id="glossaryClose"></div></div>'); glossaryTip.content = $('<div id="glossaryContent"></div>'); $('body').append(glossaryTip.holder.append(glossaryTip.content)); }, show: function(content, event){ glossaryTip.content.html(content); // Display tip at mouse cursor var x = parseInt(event.mouse_event.pageX) + 15 var y = parseInt(event.mouse_event.pageY) + 5 glossaryTip.holder.css({top: y, left: x}); // Display the tip if (glossaryTip.holder.is(':hidden')) { glossaryTip.holder.show(); } // Add click handler to close glossaryTip.holder.bind('click', function(){ glossaryTip.holder.stop(true).fadeOut(200); return false; }); } }); $.glossaryTip = function(content, event) { var tip = $.glossaryTip.instance; if (!tip) { tip = $.glossaryTip.instance = new glossaryTip(); } tip.setup(); tip.show(content, event); return tip; } })(jQuery);
수정본
파일 열기
/** * Plugin: jquery.zGlossary * * Version: 1.0.2 * (c) Copyright 2011-2013, Zazar Ltd * * Description: jQuery plugin to find and display term definitions in HTML text * * History: * 1.0.2 - Added show once option * 1.0.1 - Correct mistype to _addTerm function (Thanks Aldopaolo) * 1.0.0 - Initial release * **/ (function($){ $.fn.glossary = function(url, options) { // Set plugin defaults var defaults = { ignorecase: false, tiptag: 'h6', excludetags: [], linktarget: '_blank', showonce: false }; var options = $.extend(defaults, options); var id = 1; // Functions return this.each(function(i, e) { // Ensure any exclude tags are uppercase for comparisons $.each(options.excludetags, function(i,e) { options.excludetags[i] = e.toUpperCase(); }); // Function to find and add term var _addTerm = function(e, term, type, def) { var patfmt = term; var skip = 0; // Check the element is a text node if (e.nodeType == 3) { // Case insensistive matching option if (options.ignorecase) { var pos = e.data.toLowerCase().indexOf(patfmt.toLowerCase()); } else { var pos = e.data.indexOf(patfmt); } // Check if the term is found if (pos >= 0) { // Check for excluded tags if (jQuery.inArray($(e).parent().get(0).tagName,options.excludetags) > -1) { } else { // Create link element var spannode = document.createElement('a'); spannode.className = 'glossaryTerm'; if (type == '0') { // Popup definition spannode.id = "glossaryID" + id; spannode.href = '#'; spannode.title = 'Click for \''+ term +'\' definition'; spannode.className = 'glossaryTerm'; $(spannode).click(function(e) { $.glossaryTip('<'+ options.tiptag +'>'+ term + '</'+ options.tiptag +'><p>'+ def +'</p>', {mouse_event: e}) return false; }); } else if (type == '1') { // Wikipedia definition spannode.title = 'Click to look up \''+ term+'\' in Wikipedia'; term = term.replace(/ /g, "_"); spannode.href = 'http://en.wikipedia.org/wiki/'+term; spannode.target = options.linktarget; } else if (type == '2') { // Google search spannode.title = 'Click to search for \''+ term +'\' in Google'; term = term.replace(/ /g, "+"); spannode.href = 'http://www.google.co.uk/search?q='+term; spannode.target = options.linktarget; } else if (type == '3') { // Custom external link spannode.title = 'Click to view \''+ term +'\' definition'; spannode.href = def; spannode.target = options.linktarget; } var middlebit = e.splitText(pos); var endbit = middlebit.splitText(patfmt.length); var middleclone = middlebit.cloneNode(true); spannode.appendChild(middleclone); middlebit.parentNode.replaceChild(spannode, middlebit); skip = 1; id += 1; } } } else if (e.nodeType == 1 && e.childNodes && !/(script|style)/i.test(e.tagName)) { // Search child nodes for (var i = 0; i < e.childNodes.length; ++i) { var ret = _addTerm(e.childNodes[i], term, type, def); // If term found and show once option go to next term if (options.showonce && ret == 1) { i = e.childNodes.length; skip = 1; } else { i += ret; } } } return skip; }; // Get glossary list items $.ajax({ type: 'GET', url: url, dataType: 'json', success: function(data) { if (data) { var count = data.length; for (var i=0; i<count; i++) { // Find term in text var item = data[i]; _addTerm(e, item.term, item.type, item.definition); } } typeof options.callback == 'function' && options.callback(); }, error: function() {} }); }); }; // Glossary tip popup var glossaryTip = function() {} $.extend(glossaryTip.prototype, { setup: function(){ if ($('#glossaryTip').length) { $('#glossaryTip').remove(); } glossaryTip.holder = $('<div id="glossaryTip" style="max-width:260px;"><div id="glossaryClose"></div></div>'); glossaryTip.content = $('<div id="glossaryContent"></div>'); $('body').append(glossaryTip.holder.append(glossaryTip.content)); }, show: function(content, event){ glossaryTip.content.html(content); // Display tip at mouse cursor var x = parseInt(event.mouse_event.pageX) + 15 var y = parseInt(event.mouse_event.pageY) + 5 glossaryTip.holder.css({top: y, left: x}); // Display the tip if (glossaryTip.holder.is(':hidden')) { glossaryTip.holder.show(); } // Add click handler to close glossaryTip.holder.bind('click', function(){ glossaryTip.holder.stop(true).fadeOut(200); return false; }); } }); $.glossaryTip = function(content, event) { var tip = $.glossaryTip.instance; if (!tip) { tip = $.glossaryTip.instance = new glossaryTip(); } tip.setup(); tip.show(content, event); return tip; } })(jQuery);
비교하기