Changeset 11295
- Timestamp:
- 06/10/11 21:03:17 (2 years ago)
- Location:
- extensions/bbcode_bar
- Files:
-
- 4 modified
-
bbcode_bar.inc.php (modified) (2 diffs)
-
main.inc.php (modified) (2 diffs)
-
template/bbcode_bar.tpl (modified) (1 diff)
-
template/markitup/style.markitup.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
extensions/bbcode_bar/bbcode_bar.inc.php
r10983 r11295 5 5 { 6 6 global $template, $conf, $pwg_loaded_plugins, $page; 7 7 8 load_language('plugin.lang', dirname(__FILE__) . '/'); 8 9 $conf_bbcode_bar = unserialize($conf['bbcode_bar']); 9 10 10 11 // buttons 11 foreach(unserialize(BBcode_codes) as $key) { 12 foreach(unserialize(BBcode_codes) as $key) 13 { 12 14 if ($conf_bbcode_bar[$key]) $template->assign('BBC_'.$key, true); 13 15 } … … 18 20 // OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage') 19 21 // ) { 20 // $template->assign(' form_name', 'editComment');22 // $template->assign('bbcode_texarea', 'contenteditid'); 21 23 // } else { 22 // $template->assign(' form_name', 'addComment');24 // $template->assign('bbcode_texarea', 'contentid'); 23 25 // } 24 $template->assign('form_name', 'addComment'); 25 26 if (isset($pwg_loaded_plugins['SmiliesSupport'])) { 26 $template->assign('bbcode_texarea', 'contentid'); 27 28 // smilies 29 if (isset($pwg_loaded_plugins['SmiliesSupport'])) 30 { 27 31 $template->assign('BBC_smilies', true); 28 32 } 29 33 30 34 $template->assign('BBCODE_PATH', BBcode_PATH); 31 $template->set_filename('bbcode_bar', dirname(__FILE__).'/template/bbcode_bar.tpl'); 32 $template->parse('bbcode_bar', true); 33 34 // smilies support >2.2.a ## must be parsed after bbcode_bar, because the javascript must be after bbc's one 35 if (isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') != -1) { 35 $template->set_prefilter('picture', 'set_bbcode_bar_prefilter'); 36 37 // smilies support > 2.2.f ## must be parsed after bbcode_bar, because the javascript must be after bbc's one 38 if (isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.f') != -1) { 36 39 set_smiliessupport(); 37 40 } 41 } 42 43 function set_bbcode_bar_prefilter($content, &$smarty) 44 { 45 $search = "<label>{'Comment'|@translate}"; 46 $replace = file_get_contents(BBcode_PATH.'/template/bbcode_bar.tpl').$search; 47 return str_replace($search, $replace, $content); 38 48 } 39 49 -
extensions/bbcode_bar/main.inc.php
r10983 r11295 24 24 } 25 25 26 function add_bbcode_bar() { 26 function add_bbcode_bar() 27 { 27 28 global $page; 28 29 29 if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage') { 30 if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage') 31 { 30 32 set_bbcode_bar(); 31 33 } … … 46 48 // version 2.2.a or greater of SmiliesSupport is required 47 49 add_event_handler('loc_end_admin', 'bbcode_bar_check_smilies'); 48 function bbcode_bar_check_smilies() { 50 function bbcode_bar_check_smilies() 51 { 49 52 global $page, $template, $pwg_loaded_plugins; 50 53 51 54 if ( 52 ((isset($_GET['page']) AND $_GET['page'] == 'plugins_list') OR (isset($_GET['section']) AND $_GET['section'] == 'bbcode_bar/admin.php')) 53 AND isset($pwg_loaded_plugins['SmiliesSupport']) 54 AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.a') == -1 55 ( (isset($_GET['page']) AND $_GET['page'] == 'plugins_list') OR (isset($_GET['section']) AND $_GET['section'] == 'bbcode_bar/admin.php') ) 56 AND isset($pwg_loaded_plugins['SmiliesSupport']) AND strcmp($pwg_loaded_plugins['SmiliesSupport']['version'], '2.2.f') == -1 55 57 ) { 56 $page['warnings'][] = "BBCode Bar : SmiliesSupport has been detected, but is not up to date. Version 2.2.a or greater is required. Please update.";58 array_push($page['warnings'], "BBCode Bar : SmiliesSupport has been detected, but is not up to date. Version 2.2.a or greater is required. Please update."); 57 59 $template->assign('warnings', $page['warnings']); 58 60 } -
extensions/bbcode_bar/template/bbcode_bar.tpl
r10983 r11295 63 63 64 64 jQuery(document).ready(function() {ldelim} 65 jQuery('#{$ form_name} textarea').markItUp(BBCodeBar);65 jQuery('#{$bbcode_texarea}').markItUp(BBCodeBar); 66 66 }); 67 67 {/footer_script} -
extensions/bbcode_bar/template/markitup/style.markitup.css
r10024 r11295 1 1 /* common */ 2 2 .markItUp { 3 display:inline-block;3 display:inline-block; 4 4 } 5 5 .markItUp * { 6 margin:0px; padding:0px;7 outline:none;6 margin:0px; padding:0px; 7 outline:none; 8 8 } 9 9 .markItUp a:link, 10 10 .markItUp a:visited { 11 color:#000;12 text-decoration:none;11 color:#000; 12 text-decoration:none; 13 13 } 14 14 .markItUp textarea { 15 display:block;15 display:block; 16 16 } 17 17 .markItUpContainer { 18 font:11px Verdana, Arial, Helvetica, sans-serif;18 font:11px Verdana, Arial, Helvetica, sans-serif; 19 19 } 20 20 .markItUpEditor { 21 font:12px 'Courier New', Courier, monospace;22 padding:5px;23 clear:both;24 overflow:auto;21 font:12px 'Courier New', Courier, monospace; 22 padding:5px; 23 clear:both; 24 overflow:auto; 25 25 } 26 26 .markItUpHeader ul:first-child { 27 padding:2px; 27 padding:2px 5px; 28 min-height:22px; 28 29 margin-bottom:2px; 29 30 border-radius:2px; 30 background:url('images/bg-header.png') repeat-x;31 background:url('images/bg-header.png') repeat-x; 31 32 } 32 33 .markItUpFooter { 33 display:none;34 display:none; 34 35 } 35 36 36 37 /* first row of buttons */ 37 .markItUpHeader ul li {38 list-style:none;39 float:left;40 position:relative;41 margin:0 ;38 .markItUpHeader ul li { 39 list-style:none; 40 float:left; 41 position:relative; 42 margin:0 !important; 42 43 } 43 44 .markItUpHeader ul li:hover > ul{ 44 display:block;45 display:block; 45 46 } 46 47 .markItUpHeader ul .markItUpDropMenu { 47 background:transparent url(images/menu.png) no-repeat 120% 100%;48 margin-right:5px;48 background:transparent url(images/menu.png) no-repeat 120% 100%; 49 margin-right:5px; 49 50 } 50 51 /* next rows of buttons */ 51 52 .markItUpHeader ul ul { 52 display:none;53 position:absolute;54 top:22px; left:0px; 55 background:#FFF;56 border:1px solid #444;57 border-radius:5px;53 display:none; 54 position:absolute; 55 top:22px; left:0px; 56 background:#FFF; 57 border:1px solid #444; 58 border-radius:5px; 58 59 } 59 60 .markItUpHeader ul ul li { 60 float:none;61 margin:0px;61 float:none; 62 margin:0px; 62 63 } 63 64 .markItUpHeader ul .markItUpSize li { 64 border-bottom:1px solid #444;65 border-radius:2px;65 border-bottom:1px solid #444; 66 border-radius:2px; 66 67 } 67 68 .markItUpHeader ul .markItUpSeparator { 68 margin:2px 10px;69 width:1px;70 height:16px;71 overflow:hidden;72 background-color:#CCC;73 color:#ccc;69 margin:2px 10px !important; 70 width:1px; 71 height:16px; 72 overflow:hidden; 73 background-color:#CCC; 74 color:#ccc; 74 75 } 75 76 /* links */ 76 77 .markItUpHeader ul a { 77 display:block;78 width:16px; height:16px;79 text-indent:-10000px;80 background-position:center center;81 background-repeat:no-repeat;82 padding:2px;83 border:1px solid transparent;78 display:block; 79 width:16px; height:16px; 80 text-indent:-10000px; 81 background-position:center center; 82 background-repeat:no-repeat; 83 padding:2px; 84 border:1px solid transparent; 84 85 } 85 86 .markItUpHeader ul a:hover { 86 border-color:#08e;87 border-color:#08e; 87 88 } 88 89 .markItUpHeader ul ul a { 89 display:block;90 text-indent:0;91 border:0;90 display:block; 91 text-indent:0; 92 border:0; 92 93 } 93 94 .markItUpHeader ul .markItUpSize li a { 94 width:90px;95 padding:2px 5px 2px 25px;96 background-position:2px 50%;95 width:90px; 96 padding:2px 5px 2px 25px; 97 background-position:2px 50%; 97 98 } 98 99 .markItUpHeader ul ul a:hover { 99 100 } 100 101 .markItUpHeader ul .markItUpSize li a:hover { 101 color:#FFF;102 background-color:#000;102 color:#FFF; 103 background-color:#000; 103 104 } 104 105 105 106 /* icons definitions */ 106 107 .markItUp .markItUpBold a { 107 background-image:url(images/bold.png);108 background-image:url(images/bold.png); 108 109 } 109 110 .markItUp .markItUpItalic a { 110 background-image:url(images/italic.png);111 background-image:url(images/italic.png); 111 112 } 112 113 .markItUp .markItUpUnderline a { 113 background-image:url(images/underline.png);114 background-image:url(images/underline.png); 114 115 } 115 116 .markItUp .markItUpStroke a { 116 background-image:url(images/stroke.png);117 background-image:url(images/stroke.png); 117 118 } 118 119 119 120 .markItUp .markItUpParagraph a { 120 background-image:url(images/p.png);121 background-image:url(images/p.png); 121 122 } 122 123 .markItUp .markItUpCenter a { 123 background-image:url(images/center.png);124 background-image:url(images/center.png); 124 125 } 125 126 .markItUp .markItUpRight a { 126 background-image:url(images/right.png);127 background-image:url(images/right.png); 127 128 } 128 129 129 130 .markItUp .markItUpListUL a { 130 background-image:url(images/list-bullet.png);131 background-image:url(images/list-bullet.png); 131 132 } 132 133 .markItUp .markItUpListOL a { 133 background-image:url(images/list-numeric.png);134 background-image:url(images/list-numeric.png); 134 135 } 135 136 .markItUp .markItUpListLI a { 136 background-image:url(images/list-item.png);137 background-image:url(images/list-item.png); 137 138 } 138 139 139 .markItUp .markItUpPicture a {140 background-image:url(images/picture.png);140 .markItUp .markItUpPicture a { 141 background-image:url(images/picture.png); 141 142 } 142 143 .markItUp .markItUpLink a { 143 background-image:url(images/link.png);144 background-image:url(images/link.png); 144 145 } 145 146 .markItUp .markItUpMail a { 146 background-image:url(images/mail.png);147 background-image:url(images/mail.png); 147 148 } 148 149 .markItUp .markItUpQuote a { 149 background-image:url(images/quote.png);150 background-image:url(images/quote.png); 150 151 } 151 152 152 153 .markItUp .markItUpSize a { 153 background-image:url(images/fonts.png);154 background-image:url(images/fonts.png); 154 155 } 155 156 .markItUp .preview a { 156 background-image:url(images/preview.png);157 background-image:url(images/preview.png); 157 158 } 158 159 159 160 /* colors */ 160 161 .markItUp .markItUpColors a { 161 background-image:url(images/colors.png);162 background-image:url(images/colors.png); 162 163 } 163 .markItUp .markItUpColors ul {164 width:81px;165 padding:1px; 166 }167 .markItUp .markItUpColors li {168 border:1px solid white;169 width:25px;height:25px;170 overflow:hidden;171 padding:0px; margin:0px;172 float:left;173 border-radius:2px;174 }175 .markItUp .markItUpColors ul a {176 width:25px;height:25px;177 color:transparent;178 }179 .markItUp .markItUpColors li:hover {180 background-color:none;181 border:1px solid #08e;182 }183 184 .markItUp .markItUpColors .col1-1 a { background:yellow; }185 .markItUp .markItUpColors .col1-2 a { background:orange; }186 .markItUp .markItUpColors .col1-3 a { background:red; }187 188 .markItUp .markItUpColors .col2-1 a { background:blue; }189 .markItUp .markItUpColors .col2-2 a { background:purple; }190 .markItUp .markItUpColors .col2-3 a { background:green; }191 192 .markItUp .markItUpColors .col3-1 a { background:white; }193 .markItUp .markItUpColors .col3-2 a { background:gray; }194 .markItUp .markItUpColors .col3-3 a { background:black; }164 .markItUp .markItUpColors ul { 165 width:81px; 166 padding:1px; 167 } 168 .markItUp .markItUpColors li { 169 border:1px solid white; 170 width:25px; height:25px; 171 overflow:hidden; 172 padding:0px; margin:0px; 173 float:left; 174 border-radius:2px; 175 } 176 .markItUp .markItUpColors ul a { 177 width:25px; height:25px; 178 color:transparent; 179 } 180 .markItUp .markItUpColors li:hover { 181 background-color:none; 182 border:1px solid #08e; 183 } 184 185 .markItUp .markItUpColors .col1-1 a { background:yellow; } 186 .markItUp .markItUpColors .col1-2 a { background:orange; } 187 .markItUp .markItUpColors .col1-3 a { background:red; } 188 189 .markItUp .markItUpColors .col2-1 a { background:blue; } 190 .markItUp .markItUpColors .col2-2 a { background:purple; } 191 .markItUp .markItUpColors .col2-3 a { background:green; } 192 193 .markItUp .markItUpColors .col3-1 a { background:white; } 194 .markItUp .markItUpColors .col3-2 a { background:gray; } 195 .markItUp .markItUpColors .col3-3 a { background:black; }
![(please configure the [header_logo] section in trac.ini)](http://piwigo.org/screenshots/piwigo_logo_on_white.png)