Diff
checker
टेक्स्ट
टेक्स्ट
छवियां
दस्तावेज़
Excel
फ़ोल्डर्स
Legal
Enterprise
डेस्कटॉप
मूल्य
साइन इन करें
Diffchecker डेस्कटॉप डाउनलोड करें
टेक्स्ट की तुलना करें
दो टेक्स्ट फ़ाइलों के बीच अंतर ढूंढें
उपकरण
इतिहास
रियल-टाइम एडिटर
रिक्त स्थान छिपाएँ
अपरिवर्तित संक्षिप्त करें
लाइन रैप बंद
लेआउट
विभाजित
संयुक्त
परिवर्तन हाइलाइट करें
स्मार्ट
शब्द
अक्षर
टेक्स्ट शैलियां
दिखावट बदलें
सिंटैक्स हाइलाइटिंग
सिंटैक्स चुनें
अनदेखा करें
टेक्स्ट बदलें
पहले अंतर पर जाएँ
इनपुट संपादित करें
Diffchecker Desktop
Diffchecker चलाने का सबसे सुरक्षित तरीका। Diffchecker Desktop ऐप पाएं: आपके diffs कभी आपके कंप्यूटर से बाहर नहीं जाते!
Desktop पाएं
Untitled diff
बनाया गया
11 वर्ष पहले
Diff कभी समाप्त नहीं होता
साफ़
निर्यात करें
शेयर करें
समझाएं
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);
सेव किए गए Diffs
ऑरिजनल टेक्स्ट
फ़ाइल खोलें
/** * 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);
अंतर खोजें