الأربعاء يناير 29, 2014 12:29 am | المشاركة رقم: |
عضو مب\ع
إحصائيةالعضو | عدد المساهمات : 105 | تاريخ التسجيل : 28/01/2014 |
|
| موضوع: (JAVASCRIPT) الاقتباس السريع (JAVASCRIPT) الاقتباس السريع والصلاة والسلام على افضل الخلق سيدنا محمد عليه افضل الصلاة والسلاماما بعداليوم اتيت لكم بكود جميل جدا الا وهو الاقتباس التلقائي والسريعشرح الكود:هو عباره عن كود عندما تحددد كلام معين او المساهمه"ولكن يجب ان تحدد الكلام" كلها والضغط على اقتباس سينزل مقتبس مباشرة في الصندوق الماسي صورة للكود:
الان طريقة وضع الكود لوحة الاداره>>عناصر اضافيه>>HTML و JAVASCRIPT>>إدارة أكواد Javascript>>انشاء كود جديدالعنوان:كما تريداضف الكود الى:جميع الصفحاتكود Javascript * :للنسخه PhpBB2 - الكود:
-
$(document).ready(function(){ $("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Répondre en citant"); $(".postbody div").mouseup(function(e){ qtext = $(this).parents("tr.post"); if (window.getSelection) theSelection = window.getSelection().toString(); else if (document.getSelection) theSelection = document.getSelection(); else if (document.selection) theSelection = document.selection.createRange().text; }); $("a:has(.i_icon_quote)").click(function () { uname = qtext.find(".name strong a").text(); $("div.sceditor-toolbar + iframe").contents().find("body").append('<blockquote><cite>' + uname + '</cite>' + theSelection + '</blockquote> <br />'); $('.sceditor-container textarea')[0].value += '[quote="' + uname + '"]' + theSelection + '[/quote]' }); }); للنسخه PhpBB3 - الكود:
-
$(document).ready(function(){ $("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Répondre en citant"); $(".postbody .content div").mouseup(function(e){ qtext = $(this).parents(".post"); if (window.getSelection) theSelection = window.getSelection().toString(); else if (document.getSelection) theSelection = document.getSelection(); else if (document.selection) theSelection = document.selection.createRange().text; }); $("a:has(.i_icon_quote)").click(function () { uname = qtext.find(".postprofile dl dt strong a").text(); $("div.sceditor-toolbar + iframe").contents().find("body").append('<blockquote><cite>' + uname + '</cite>' + theSelection + '</blockquote> <br />'); $('.sceditor-container textarea')[0].value += '[quote="' + uname + '"]' + theSelection + '[/quote]' }); }); للنسخة PunBB - الكود:
-
$(document).ready(function(){ $("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Répondre en citant"); $(".entry-content div").mouseup(function(e){ qtext = $(this).parents(".post"); if (window.getSelection) theSelection = window.getSelection().toString(); else if (document.getSelection) theSelection = document.getSelection(); else if (document.selection) theSelection = document.selection.createRange().text; }); $("a:has(.i_icon_quote)").click(function () { uname = qtext.find(".username a").text(); $("div.sceditor-toolbar + iframe").contents().find("body").append('<blockquote><cite>' + uname + '</cite>' + theSelection + '</blockquote> <br />'); $('.sceditor-container textarea')[0].value += '[quote="' + uname + '"]' + theSelection + '[/quote]' }); }); للنسخة Invision - الكود:
-
$(document).ready(function(){ $("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Répondre en citant"); $(".post-entry div").mouseup(function(e){ qtext = $(this).parents(".post"); if (window.getSelection) theSelection = window.getSelection().toString(); else if (document.getSelection) theSelection = document.getSelection(); else if (document.selection) theSelection = document.selection.createRange().text; }); $("a:has(.i_icon_quote)").click(function () { uname = qtext.find(".postprofile-details dt a + br + a").text(); $("div.sceditor-toolbar + iframe").contents().find("body").append('<blockquote><cite>' + uname + '</cite>' + theSelection + '</blockquote> <br />'); $('.sceditor-container textarea')[0].value += '[quote="' + uname + '"]' + theSelection + '[/quote]' }); }); ثانيا يمكنك وضع زر بجوار ازرار تعديل واقتباس يؤدي نفس وظيفة الكود السابق مع ايضا جعل كود الاقتباس يعمل بدون مشكلةوذلك عن طريق كود الجافا الذي اضفته كما وضحت في الاعلي حسب نسخة منتداك عن طريق استبدال الكود التالي(1) "الموجود في كود الجافا الذي وضحته فوق حسب نسخة منتداك": - الكود:
-
$("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Répondre en citant"); بالكود هذا: - الكود:
-
$("a:has(.i_icon_quote)").after($('<a href="#quick_reply"><img src="رابط صورة الزر هنا" class="quickquote" alt="Citation rapide" title="Citation rapide" /></a>')); ملحوظه:عليك استبدال كلمة رابط الصورة الزر هنا برابط الصورة التي تريدها ثم استبدال الكود التالي (2)"الموجود في كود الجافا الذي وضحته فوق حسب نسخة منتداك": - الكود:
-
$("a:has(.i_icon_quote)").click(function () { بهذا الكود : - الكود:
-
$(".quickquote").click(function () { منقول للافادة وبهذا قد انتهى الشرح بالتوفيق ليكم
|
| |