-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the stefan- wiki!
/*
- Copyright 2014 Facebook, Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
#include "folly/Unicode.h"
namespace folly {
//////////////////////////////////////////////////////////////////////
fbstring codePointToUtf8(char32_t cp) { fbstring result;
// Based on description from http://en.wikipedia.org/wiki/UTF-8.
if (cp <= 0x7f) { result.resize(1); result[0] = static_cast(cp); } else if (cp <= 0x7FF) { result.resize(2); result[1] = static_cast(0x80 | (0x3f & cp)); result[0] = static_cast(0xC0 | (cp >> 6)); } else if (cp <= 0xFFFF) { result.resize(3); result[2] = static_cast(0x80 | (0x3f & cp)); result[1] = (0x80 | static_cast((0x3f & (cp >> 6)))); result[0] = (0xE0 | static_cast(cp >> 12)); } else if (cp <= 0x10FFFF) { result.resize(4); result[3] = static_cast(0x80 | (0x3f & cp)); result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); result[0] = static_cast(0xF0 | (cp >> 18)); }
return result; }
//////////////////////////////////////////////////////////////////////
}
media.php line 738 - 756
$output = apply_filters('gallery_style', "
<style type='text/css'> #{$selector} { margin: auto; } #{$selector} .gallery-item { float: {$float}; margin-top: 10px; text-align: center; width: {$itemwidth}%; } #{$selector} img { border: 2px solid #cfcfcf; } #{$selector} .gallery-caption { margin-left: 0; } </style>img borders and margins as hard coded by default, why?? there is no chance to change that with overwrites, because the css will render directly before the gallery code appears. the width percentage is the only css part what may need to be set to handle the count of columns correctly by default. but the rest makes absolutely no sense inside of the php core file ...