2013-02-15 4 views
1

현재 Jquery/Javascript로 작성된 BB 코드 스크립트를 쉽게 편집 할 수 있습니다. 문제는 내가 원하는만큼 쉽지 않으므로 도움이 필요합니다.BB 코드 목록 Javascript

스크립트가 제대로 작동합니다 (텍스트 영역에 내용 추가). 그러나 나는 프리젠 테이션을 조금 더 낫게하려고 노력 중이다.

누군가가 항목을 비공개하거나 최소한 buttet 포인트를 숨기는 방법을 말해 줄 수 있으면 감사하겠습니다. 그렇지 않으면 javascript/jquery를 편집 할 수 있습니다.

또한 (굵은 단추) 옵션을 스크롤 할 때 코드를 단추로 (제목으로) 표시하지만이 코드를 제거하고 싶습니다. 코드를 수정할 수있는 부분을 볼 수 없습니다. .

// ---------------------------------------------------------------------------- 
// markItUp! 
// ---------------------------------------------------------------------------- 
// Copyright (C) 2008 Jay Salvat 
// http://markitup.jaysalvat.com/ 
// ---------------------------------------------------------------------------- 
myBbcodeSettings = { 
    nameSpace:   "bbcode", // Useful to prevent multi-instances CSS conflict 
    previewParserPath: "~/sets/bbcode/preview.php", 
    markupSet: [ 
     {name:"<img src='_img/bold_icon.gif'>", key:'B', openWith:'[b]', closeWith:'[/b]'}, 
     {name:'Italic', key:'I', openWith:'[i]', closeWith:'[/i]'}, 
     {name:'Underline', key:'U', openWith:'[u]', closeWith:'[/u]'}, 
     {separator:'---------------' }, 
     {name:'Picture', key:'P', replaceWith:'[img][![Url]!][/img]'}, 
     {name:'Link', key:'L', openWith:'[url=[![Url]!]]', closeWith:'[/url]', placeHolder:'Your text to link here...'}, 
     {separator:'---------------' }, 
     {name:'Colors', openWith:'[color=[![Color]!]]', closeWith:'[/color]', dropMenu: [ 
      {name:'Yellow', openWith:'[color=yellow]', closeWith:'[/color]', className:"col1-1" }, 
      {name:'Orange', openWith:'[color=orange]', closeWith:'[/color]', className:"col1-2" }, 
      {name:'Red', openWith:'[color=red]', closeWith:'[/color]', className:"col1-3" }, 
      {name:'Blue', openWith:'[color=blue]', closeWith:'[/color]', className:"col2-1" }, 
      {name:'Purple', openWith:'[color=purple]', closeWith:'[/color]', className:"col2-2" }, 
      {name:'Green', openWith:'[color=green]', closeWith:'[/color]', className:"col2-3" }, 
      {name:'White', openWith:'[color=white]', closeWith:'[/color]', className:"col3-1" }, 
      {name:'Gray', openWith:'[color=gray]', closeWith:'[/color]', className:"col3-2" }, 
      {name:'Black', openWith:'[color=black]', closeWith:'[/color]', className:"col3-3" } 
     ]}, 
     {name:'Size', key:'S', openWith:'[size=[![Text size]!]]', closeWith:'[/size]', dropMenu :[ 
      {name:'Big', openWith:'[size=200]', closeWith:'[/size]' }, 
      {name:'Normal', openWith:'[size=100]', closeWith:'[/size]' }, 
      {name:'Small', openWith:'[size=50]', closeWith:'[/size]' } 
     ]}, 
     {separator:'---------------' }, 
     {name:'Bulleted list', openWith:'[list]\n', closeWith:'\n[/list]'}, 
     {name:'Numeric list', openWith:'[list=[![Starting number]!]]\n', closeWith:'\n[/list]'}, 
     {name:'List item', openWith:'[*] '}, 
     {separator:'---------------' }, 
     {name:'Quotes', openWith:'[quote]', closeWith:'[/quote]'}, 
     {name:'Code', openWith:'[code]', closeWith:'[/code]'}, 
     {separator:'---------------' }, 
     {name:'Clean', className:"clean", replaceWith:function(h) { return h.selection.replace(/\[(.*?)\]/g, "") } }, 
     {name:'Preview', className:"preview", call:'preview' } 
    ] 
} 

당신이 내게 줄 수있는 모든 도움을 주셔서 감사합니다

Screenshot of list/bb options

여기 내 자바 스크립트 코드입니다! :)

답변

1

PHP를 사용하여 텍스트를 추가하는 간단한 스크립트를 사용합니다.