Revision 2090
Added by darkviper almost 11 years ago
branches/2.8.x/CHANGELOG | ||
---|---|---|
11 | 11 |
! = Update/Change |
12 | 12 |
=============================================================================== |
13 | 13 |
|
14 |
19 Jan-2014 Build 2089 Manuela v.d.Decken(DarkViper) |
|
15 |
! UpgradeHelper: added method delTree() |
|
16 |
- templates/argos_theme |
|
17 |
- templates/allcss |
|
18 |
- templates/wb_theme |
|
19 |
+ templates/WbTheme |
|
20 |
! all upgrade/install and all other files needed to change defaults |
|
21 |
# modules/MultiLingual/update_keys.php inactive lines of code removed |
|
14 | 22 |
19 Jan-2014 Build 2088 Manuela v.d.Decken(DarkViper) |
15 | 23 |
# news/delete_post invalid arguments for AccessFile corrected |
16 | 24 |
! search/search.php read settings optimized |
branches/2.8.x/wb/upgrade-script.php | ||
---|---|---|
79 | 79 |
if (is_readable($config_file) && !defined('WB_URL')) { |
80 | 80 |
require_once($config_file); |
81 | 81 |
} |
82 |
$oReg = WbAdaptor::getInstance(); |
|
82 | 83 |
UpgradeHelper::checkSetupFiles(dirname(__FILE__).'/'); |
83 | 84 |
|
84 | 85 |
if (!class_exists('admin', false)) { |
... | ... | |
120 | 121 |
|
121 | 122 |
$OK = ' <span class="ok">OK</span> '; |
122 | 123 |
$FAIL = ' <span class="error">FAILED</span> '; |
123 |
$DEFAULT_THEME = 'wb_theme';
|
|
124 |
$DEFAULT_THEME = 'WbTheme';
|
|
124 | 125 |
|
125 | 126 |
$stepID = 1; |
126 | 127 |
$dirRemove = array( |
127 |
/* |
|
128 |
'[TEMPLATE]/allcss/', |
|
129 |
'[TEMPLATE]/blank/', |
|
130 |
'[TEMPLATE]/round/', |
|
131 |
'[TEMPLATE]/simple/', |
|
132 |
*/ |
|
133 |
'[ADMIN]/themes/', |
|
128 |
// '[TEMPLATE]allcss/', |
|
129 |
// '[TEMPLATE]blank/', |
|
130 |
// '[TEMPLATE]round/', |
|
131 |
// '[TEMPLATE]simple/', |
|
132 |
'[TEMPLATE]wb_theme/', |
|
133 |
'[ADMIN]themes/' |
|
134 | 134 |
); |
135 |
// |
|
135 |
|
|
136 | 136 |
$aRemoveSingleFiles = array( |
137 |
'[ADMIN]/preferences/details.php',
|
|
138 |
'[ADMIN]/preferences/email.php',
|
|
139 |
'[ADMIN]/preferences/password.php',
|
|
140 |
'[ADMIN]/pages/settings2.php',
|
|
141 |
'[ADMIN]/users/users.php',
|
|
142 |
'[ADMIN]/groups/add.php',
|
|
143 |
'[ADMIN]/groups/groups.php',
|
|
144 |
'[ADMIN]/groups/save.php',
|
|
145 |
'[ADMIN]/skel/themes/htt/groups.htt',
|
|
137 |
'[ADMIN]preferences/details.php', |
|
138 |
'[ADMIN]preferences/email.php', |
|
139 |
'[ADMIN]preferences/password.php', |
|
140 |
'[ADMIN]pages/settings2.php', |
|
141 |
'[ADMIN]users/users.php', |
|
142 |
'[ADMIN]groups/add.php', |
|
143 |
'[ADMIN]groups/groups.php', |
|
144 |
'[ADMIN]groups/save.php', |
|
145 |
'[ADMIN]skel/themes/htt/groups.htt', |
|
146 | 146 |
|
147 |
'[FRAMEWORK]/class.msg_queue.php', |
|
148 |
'[FRAMEWORK]/class.logfile.php', |
|
149 |
'[FRAMEWORK]/PasswordHash.php', |
|
150 |
'[MODULES]/droplets/js/mdcr.js', |
|
151 |
|
|
147 |
'[FRAMEWORK]class.msg_queue.php', |
|
148 |
'[FRAMEWORK]class.logfile.php', |
|
149 |
'[FRAMEWORK]PasswordHash.php', |
|
150 |
'[MODULES]droplets/js/mdcr.js' |
|
152 | 151 |
); |
153 |
|
|
154 | 152 |
// deleting files below only from less 2.8.4 stable |
155 | 153 |
if(version_compare(WB_VERSION, '2.8.4', '<')) |
156 | 154 |
{ |
157 | 155 |
$aRemoveOldTemplates = array( |
158 |
|
|
159 |
'[TEMPLATE]/argos_theme/templates/access.htt', |
|
160 |
'[TEMPLATE]/argos_theme/templates/addons.htt', |
|
161 |
'[TEMPLATE]/argos_theme/templates/admintools.htt', |
|
162 |
'[TEMPLATE]/argos_theme/templates/error.htt', |
|
163 |
'[TEMPLATE]/argos_theme/templates/groups.htt', |
|
164 |
'[TEMPLATE]/argos_theme/templates/groups_form.htt', |
|
165 |
'[TEMPLATE]/argos_theme/templates/languages.htt', |
|
166 |
'[TEMPLATE]/argos_theme/templates/languages_details.htt', |
|
167 |
'[TEMPLATE]/argos_theme/templates/login.htt', |
|
168 |
'[TEMPLATE]/argos_theme/templates/login_forgot.htt', |
|
169 |
'[TEMPLATE]/argos_theme/templates/media.htt', |
|
170 |
'[TEMPLATE]/argos_theme/templates/media_browse.htt', |
|
171 |
'[TEMPLATE]/argos_theme/templates/media_rename.htt', |
|
172 |
'[TEMPLATE]/argos_theme/templates/modules.htt', |
|
173 |
'[TEMPLATE]/argos_theme/templates/modules_details.htt', |
|
174 |
'[TEMPLATE]/argos_theme/templates/pages.htt', |
|
175 |
'[TEMPLATE]/argos_theme/templates/pages_modify.htt', |
|
176 |
'[TEMPLATE]/argos_theme/templates/pages_sections.htt', |
|
177 |
'[TEMPLATE]/argos_theme/templates/pages_settings.htt', |
|
178 |
'[TEMPLATE]/argos_theme/templates/preferences.htt', |
|
179 |
'[TEMPLATE]/argos_theme/templates/setparameter.htt', |
|
180 |
'[TEMPLATE]/argos_theme/templates/settings.htt', |
|
181 |
'[TEMPLATE]/argos_theme/templates/start.htt', |
|
182 |
'[TEMPLATE]/argos_theme/templates/success.htt', |
|
183 |
'[TEMPLATE]/argos_theme/templates/templates.htt', |
|
184 |
'[TEMPLATE]/argos_theme/templates/templates_details.htt', |
|
185 |
'[TEMPLATE]/argos_theme/templates/users.htt', |
|
186 |
'[TEMPLATE]/argos_theme/templates/users_form.htt', |
|
187 |
|
|
188 |
'[TEMPLATE]/wb_theme/templates/access.htt', |
|
189 |
'[TEMPLATE]/wb_theme/templates/addons.htt', |
|
190 |
'[TEMPLATE]/wb_theme/templates/admintools.htt', |
|
191 |
'[TEMPLATE]/wb_theme/templates/error.htt', |
|
192 |
'[TEMPLATE]/wb_theme/templates/groups.htt', |
|
193 |
'[TEMPLATE]/wb_theme/templates/groups_form.htt', |
|
194 |
'[TEMPLATE]/wb_theme/templates/languages.htt', |
|
195 |
'[TEMPLATE]/wb_theme/templates/languages_details.htt', |
|
196 |
'[TEMPLATE]/wb_theme/templates/login.htt', |
|
197 |
'[TEMPLATE]/wb_theme/templates/login_forgot.htt', |
|
198 |
'[TEMPLATE]/wb_theme/templates/media.htt', |
|
199 |
'[TEMPLATE]/wb_theme/templates/media_browse.htt', |
|
200 |
'[TEMPLATE]/wb_theme/templates/media_rename.htt', |
|
201 |
'[TEMPLATE]/wb_theme/templates/modules.htt', |
|
202 |
'[TEMPLATE]/wb_theme/templates/modules_details.htt', |
|
203 |
'[TEMPLATE]/wb_theme/templates/pages.htt', |
|
204 |
'[TEMPLATE]/wb_theme/templates/pages_modify.htt', |
|
205 |
'[TEMPLATE]/wb_theme/templates/pages_sections.htt', |
|
206 |
'[TEMPLATE]/wb_theme/templates/pages_settings.htt', |
|
207 |
'[TEMPLATE]/wb_theme/templates/preferences.htt', |
|
208 |
'[TEMPLATE]/wb_theme/templates/setparameter.htt', |
|
209 |
'[TEMPLATE]/wb_theme/templates/settings.htt', |
|
210 |
'[TEMPLATE]/wb_theme/templates/start.htt', |
|
211 |
'[TEMPLATE]/wb_theme/templates/success.htt', |
|
212 |
'[TEMPLATE]/wb_theme/templates/templates.htt', |
|
213 |
'[TEMPLATE]/wb_theme/templates/templates_details.htt', |
|
214 |
'[TEMPLATE]/wb_theme/templates/users.htt', |
|
215 |
'[TEMPLATE]/wb_theme/templates/users_form.htt' |
|
156 |
'[TEMPLATE]argos_theme/templates/access.htt', |
|
157 |
'[TEMPLATE]argos_theme/templates/addons.htt', |
|
158 |
'[TEMPLATE]argos_theme/templates/admintools.htt', |
|
159 |
'[TEMPLATE]argos_theme/templates/error.htt', |
|
160 |
'[TEMPLATE]argos_theme/templates/groups.htt', |
|
161 |
'[TEMPLATE]argos_theme/templates/groups_form.htt', |
|
162 |
'[TEMPLATE]argos_theme/templates/languages.htt', |
|
163 |
'[TEMPLATE]argos_theme/templates/languages_details.htt', |
|
164 |
'[TEMPLATE]argos_theme/templates/login.htt', |
|
165 |
'[TEMPLATE]argos_theme/templates/login_forgot.htt', |
|
166 |
'[TEMPLATE]argos_theme/templates/media.htt', |
|
167 |
'[TEMPLATE]argos_theme/templates/media_browse.htt', |
|
168 |
'[TEMPLATE]argos_theme/templates/media_rename.htt', |
|
169 |
'[TEMPLATE]argos_theme/templates/modules.htt', |
|
170 |
'[TEMPLATE]argos_theme/templates/modules_details.htt', |
|
171 |
'[TEMPLATE]argos_theme/templates/pages.htt', |
|
172 |
'[TEMPLATE]argos_theme/templates/pages_modify.htt', |
|
173 |
'[TEMPLATE]argos_theme/templates/pages_sections.htt', |
|
174 |
'[TEMPLATE]argos_theme/templates/pages_settings.htt', |
|
175 |
'[TEMPLATE]argos_theme/templates/preferences.htt', |
|
176 |
'[TEMPLATE]argos_theme/templates/setparameter.htt', |
|
177 |
'[TEMPLATE]argos_theme/templates/settings.htt', |
|
178 |
'[TEMPLATE]argos_theme/templates/start.htt', |
|
179 |
'[TEMPLATE]argos_theme/templates/success.htt', |
|
180 |
'[TEMPLATE]argos_theme/templates/templates.htt', |
|
181 |
'[TEMPLATE]argos_theme/templates/templates_details.htt', |
|
182 |
'[TEMPLATE]argos_theme/templates/users.htt', |
|
183 |
'[TEMPLATE]argos_theme/templates/users_form.htt' |
|
216 | 184 |
); |
217 | 185 |
}else { |
218 | 186 |
$aRemoveOldTemplates = array(); |
... | ... | |
282 | 250 |
#container { |
283 | 251 |
min-width:48em; |
284 | 252 |
width: 70%; |
285 |
background: #A8BCCB url(<?php echo WB_URL; ?>/templates/wb_theme/images/background.png) repeat-x;
|
|
253 |
background: #A8BCCB url(<?php echo WB_URL; ?>/templates/<?php echo $DEFAULT_THEME; ?>/images/background.png) repeat-x;
|
|
286 | 254 |
border:1px solid #000; |
287 | 255 |
color:#000; |
288 | 256 |
margin:2em auto; |
... | ... | |
355 | 323 |
<body> |
356 | 324 |
<div id="container"> |
357 | 325 |
<div class="page"> |
358 |
<img src="<?php echo WB_URL; ?>/templates/wb_theme/images/logo.png" alt="WebsiteBaker Project" />
|
|
326 |
<img src="<?php echo WB_URL; ?>/templates/<?php echo $DEFAULT_THEME; ?>/images/logo.png" alt="WebsiteBaker Project" />
|
|
359 | 327 |
<div class="content"> |
360 | 328 |
<h1>WebsiteBaker Upgrade</h1> |
361 | 329 |
<?php |
... | ... | |
794 | 762 |
} |
795 | 763 |
echo '</div>'; |
796 | 764 |
} |
797 |
|
|
798 | 765 |
if(version_compare(WB_REVISION, REVISION, '<=')) |
799 | 766 |
{ |
800 | 767 |
$aDebugMessage = array(); |
... | ... | |
954 | 921 |
'[TEMPLATE]' |
955 | 922 |
); |
956 | 923 |
$replacements = array( |
957 |
'/'.substr(ADMIN_PATH, strlen(WB_PATH)+1),
|
|
958 |
MEDIA_DIRECTORY,
|
|
959 |
PAGES_DIRECTORY,
|
|
960 |
'/framework',
|
|
961 |
'/modules',
|
|
962 |
'/templates'
|
|
924 |
$oReg->AcpDir,
|
|
925 |
$oReg->MediaDir,
|
|
926 |
$oReg->PagesDir,
|
|
927 |
'framework/',
|
|
928 |
'modules/',
|
|
929 |
'templates/'
|
|
963 | 930 |
); |
964 | 931 |
|
965 | 932 |
$msg = ''; |
... | ... | |
968 | 935 |
foreach( $aFilesToRemove as $file ) |
969 | 936 |
{ |
970 | 937 |
$file = str_replace($searches, $replacements, $file); |
971 |
if( is_writable(WB_PATH.'/'.$file) ) {
|
|
938 |
if( is_writable($oReg->AppDir.$file) ) {
|
|
972 | 939 |
$iFound++; |
973 | 940 |
// try to unlink file |
974 |
if(!unlink(WB_PATH.$file)) {
|
|
941 |
if(!unlink($oReg->AppDir.$file)) {
|
|
975 | 942 |
$iFailed++; |
976 | 943 |
} |
977 | 944 |
} |
978 |
if( is_readable(WB_PATH.'/'.$file) ) {
|
|
945 |
if( is_readable($oReg->AppDir.$file) ) {
|
|
979 | 946 |
// save in err-list, if failed |
980 | 947 |
$msg .= $file.'<br />'; |
981 | 948 |
} |
... | ... | |
1007 | 974 |
|
1008 | 975 |
|
1009 | 976 |
/********************************************************** |
1010 |
* - check for deprecated / never needed files
|
|
977 |
* - check for deprecated / never needed folders
|
|
1011 | 978 |
*/ |
1012 | 979 |
$iLoaded = sizeof($dirRemove); |
1013 | 980 |
if($iLoaded) { |
... | ... | |
1018 | 985 |
'[ADMIN]', |
1019 | 986 |
'[MEDIA]', |
1020 | 987 |
'[PAGES]', |
988 |
'[FRAMEWORK]', |
|
989 |
'[MODULES]', |
|
1021 | 990 |
'[TEMPLATE]' |
1022 | 991 |
); |
1023 | 992 |
$replacements = array( |
1024 |
substr(ADMIN_PATH, strlen(WB_PATH)+1), |
|
1025 |
MEDIA_DIRECTORY, |
|
1026 |
PAGES_DIRECTORY, |
|
1027 |
'/templates', |
|
993 |
$oReg->AcpDir, |
|
994 |
$oReg->MediaDir, |
|
995 |
$oReg->PagesDir, |
|
996 |
'framework/', |
|
997 |
'modules/', |
|
998 |
'templates/' |
|
1028 | 999 |
); |
1029 | 1000 |
$msg = ''; |
1030 | 1001 |
echo '<div style="margin-left:2em;">'; |
1031 | 1002 |
echo '<h4>Search '.$iLoaded.' deprecated and outdated folders</h4>'; |
1032 |
foreach( $dirRemove as $dir ) { |
|
1033 |
$dir = str_replace($searches, $replacements, $dir); |
|
1034 |
$dir = WB_PATH.'/'.$dir; |
|
1035 |
if( is_dir( $dir )) { |
|
1036 |
$iFound++; |
|
1037 |
// try to delete dir |
|
1038 |
if(!is_writable( $dir ) || !rm_full_dir($dir)) { |
|
1039 |
// save in err-list, if failed |
|
1040 |
$iFailed++; |
|
1041 |
} |
|
1042 |
} |
|
1043 |
if( is_readable(WB_PATH.'/'.$dir) ) { |
|
1044 |
$msg .= str_replace(WB_PATH,'',$dir).'<br />'; |
|
1045 |
} |
|
1046 |
} |
|
1047 |
|
|
1048 |
$iRemove = $iFound-$iFailed; |
|
1049 |
echo '<strong>Remove '.$iRemove.' from '.$iFound.' founded</strong> '; |
|
1003 |
foreach( $dirRemove as $sRootDir ) { |
|
1004 |
$sRootDir = str_replace($searches, $replacements, $sRootDir); |
|
1005 |
if (file_exists($oReg->AppPath.$sRootDir)) { |
|
1006 |
if (!UpgradeHelper::delTree($oReg->AppPath.$sRootDir, UpgradeHelper::DEL_ROOT_DELETE)) { |
|
1007 |
$iFailed = sizeof(($msg = UpgradeHelper::getDelTreeLog())); |
|
1008 |
$msg = implode('<br />', $msg); |
|
1009 |
} |
|
1010 |
} |
|
1011 |
} |
|
1050 | 1012 |
echo ($iFailed == 0) ? $OK : $FAIL; |
1051 | 1013 |
echo '</div>'; |
1052 |
|
|
1053 | 1014 |
if($msg != '') { |
1054 | 1015 |
$msg = '<br /><br />Following directories are deprecated, outdated or a security risk and |
1055 | 1016 |
can not be removed automatically.<br /><br />Please delete them |
... | ... | |
1066 | 1027 |
</html>"; |
1067 | 1028 |
exit; |
1068 | 1029 |
} |
1069 |
|
|
1070 |
|
|
1071 | 1030 |
} |
1072 | 1031 |
|
1073 | 1032 |
/********************************************************** |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
51 | 51 |
|
52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.4'); |
54 |
if(!defined('REVISION')) define('REVISION', '2088');
|
|
54 |
if(!defined('REVISION')) define('REVISION', '2089');
|
|
55 | 55 |
if(!defined('SP')) define('SP', ''); |
branches/2.8.x/wb/framework/UpgradeHelper.php | ||
---|---|---|
35 | 35 |
class UpgradeHelper { |
36 | 36 |
|
37 | 37 |
/** |
38 |
* do not delete start directory of deltree |
|
39 |
*/ |
|
40 |
const DEL_ROOT_PRESERVE = 0; |
|
41 |
/** |
|
42 |
* delete start directory of deltree |
|
43 |
*/ |
|
44 |
const DEL_ROOT_DELETE = 1; |
|
45 |
/** |
|
46 |
* clear logs |
|
47 |
*/ |
|
48 |
const LOG_CLEAR = true; |
|
49 |
/** |
|
50 |
* preserve logs |
|
51 |
*/ |
|
52 |
const LOG_PRESERVE = false; |
|
53 |
/** |
|
54 |
* to store the last delTree log |
|
55 |
*/ |
|
56 |
static $aDelTreeLog = array(); |
|
57 |
|
|
58 |
/** |
|
38 | 59 |
* Compare available tables against a list of tables |
39 | 60 |
* @param array list of needed table names without TablePrefix |
40 | 61 |
* @return array list of missing tables |
... | ... | |
265 | 286 |
} |
266 | 287 |
return false; |
267 | 288 |
} |
289 |
/** |
|
290 |
* Delete all contents of basedir, but not the basedir itself |
|
291 |
* @param string $sRootDir the content of which should be deleted |
|
292 |
* @param integer $iMode the mode can be set to self::DEL_ROOT_PRESERVE(default) or self::DEL_ROOT_DELETE |
|
293 |
* @return boolean false if a file or directory can't be deleted |
|
294 |
*/ |
|
295 |
static public function delTree($sRootDir, $iMode = self::DEL_ROOT_PRESERVE) |
|
296 |
{ |
|
297 |
// check if root dir is inside the installation and is writeable |
|
298 |
$oReg = WbAdaptor::getInstance(); |
|
299 |
self::$aDelTreeLog = array(); |
|
300 |
$bResult = true; |
|
301 |
if (!is_writeable($sRootDir)) { |
|
302 |
self::$aDelTreeLog[] = str_replace($oReg->AppPath, '', $sRootDir); |
|
303 |
return false; |
|
304 |
} |
|
305 |
$oIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sRootDir), RecursiveIteratorIterator::CHILD_FIRST); |
|
306 |
foreach ($oIterator as $oPath) { |
|
307 |
$sPath = rtrim(str_replace('\\', '/', $oPath->__toString()), '/'); |
|
308 |
if ($oPath->isDir() && !preg_match('/\.$/s', $sPath)) { |
|
309 |
// proceed directories |
|
310 |
if (!rmdir($sPath)) { |
|
311 |
$bResult = false; |
|
312 |
self::$aDelTreeLog[] = str_replace($oReg->AppPath, '', $sPath); |
|
313 |
} |
|
314 |
} elseif ($oPath->isFile()) { |
|
315 |
// proceed files |
|
316 |
if (!unlink($sPath)) { |
|
317 |
$bResult = false; |
|
318 |
self::$aDelTreeLog[] = str_replace($oReg->AppPath, '', $sPath); |
|
319 |
} |
|
320 |
} |
|
321 |
} |
|
322 |
if (($iMode & self::DEL_ROOT_DELETE) && $bResult) { |
|
323 |
// delete RootDir if there was no error before |
|
324 |
if (!rmdir($sRootDir)) { |
|
325 |
$bResult = false; |
|
326 |
self::$aDelTreeLog[] = str_replace($oReg->AppPath, '', $sRootDir); |
|
327 |
} |
|
328 |
} |
|
329 |
return $bResult; |
|
330 |
} |
|
331 |
/** |
|
332 |
* returns the log of the last delTree request |
|
333 |
* @param bool $bClearLog TRUE clears the log after request, FALSE preserve the log |
|
334 |
* @return array |
|
335 |
*/ |
|
336 |
static public function getDelTreeLog($bClearLog = self::LOG_CLEAR) |
|
337 |
{ |
|
338 |
$aRetval = self::$aDelTreeLog; |
|
339 |
if($bClearLog) { self::$aDelTreeLog = array(); } |
|
340 |
return $aRetval; |
|
341 |
} |
|
268 | 342 |
|
343 |
|
|
269 | 344 |
} // end of class UpgradeHelper |
270 | 345 |
|
branches/2.8.x/wb/templates/WbTheme/jquery/jquery-corner.js | ||
---|---|---|
1 |
/*! |
|
2 |
* jQuery corner plugin: simple corner rounding |
|
3 |
* Examples and documentation at: http://jquery.malsup.com/corner/ |
|
4 |
* version 1.96 (11-MAY-2009) |
|
5 |
* Dual licensed under the MIT and GPL licenses: |
|
6 |
* http://www.opensource.org/licenses/mit-license.php |
|
7 |
* http://www.gnu.org/licenses/gpl.html |
|
8 |
*/ |
|
9 |
|
|
10 |
/** |
|
11 |
* corner() takes a single string argument: $('#myDiv').corner("effect corners width") |
|
12 |
* |
|
13 |
* effect: name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). |
|
14 |
* corners: one or more of: top, bottom, tr, tl, br, or bl. |
|
15 |
* by default, all four corners are adorned. |
|
16 |
* width: width of the effect; in the case of rounded corners this is the radius. |
|
17 |
* specify this value using the px suffix such as 10px (and yes, it must be pixels). |
|
18 |
* |
|
19 |
* @name corner |
|
20 |
* @type jQuery |
|
21 |
* @param String options Options which control the corner style |
|
22 |
* @cat Plugins/Corner |
|
23 |
* @return jQuery |
|
24 |
* @author Dave Methvin (http://methvin.com/jquery/jq-corner.html) |
|
25 |
* @author Mike Alsup (http://jquery.malsup.com/corner/) |
|
26 |
*/ |
|
27 |
;(function($) { |
|
28 |
|
|
29 |
var expr = (function() { |
|
30 |
var div = document.createElement('div'); |
|
31 |
try { div.style.setExpression('width','0+0'); } |
|
32 |
catch(e) { return false; } |
|
33 |
return true; |
|
34 |
})(); |
|
35 |
|
|
36 |
function sz(el, p) { |
|
37 |
return parseInt($.css(el,p))||0; |
|
38 |
}; |
|
39 |
function hex2(s) { |
|
40 |
var s = parseInt(s).toString(16); |
|
41 |
return ( s.length < 2 ) ? '0'+s : s; |
|
42 |
}; |
|
43 |
function gpc(node) { |
|
44 |
for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) { |
|
45 |
var v = $.css(node,'backgroundColor'); |
|
46 |
if ( v.indexOf('rgb') >= 0 ) { |
|
47 |
if ($.browser.safari && v == 'rgba(0, 0, 0, 0)') |
|
48 |
continue; |
|
49 |
var rgb = v.match(/\d+/g); |
|
50 |
return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]); |
|
51 |
} |
|
52 |
if ( v && v != 'transparent' ) |
|
53 |
return v; |
|
54 |
} |
|
55 |
return '#ffffff'; |
|
56 |
}; |
|
57 |
|
|
58 |
function getWidth(fx, i, width) { |
|
59 |
switch(fx) { |
|
60 |
case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width)))); |
|
61 |
case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width)))); |
|
62 |
case 'sharp': return Math.round(width*(1-Math.cos(Math.acos(i/width)))); |
|
63 |
case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width)))); |
|
64 |
case 'slide': return Math.round(width*(Math.atan2(i,width/i))); |
|
65 |
case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1)))); |
|
66 |
case 'curl': return Math.round(width*(Math.atan(i))); |
|
67 |
case 'tear': return Math.round(width*(Math.cos(i))); |
|
68 |
case 'wicked': return Math.round(width*(Math.tan(i))); |
|
69 |
case 'long': return Math.round(width*(Math.sqrt(i))); |
|
70 |
case 'sculpt': return Math.round(width*(Math.log((width-i-1),width))); |
|
71 |
case 'dog': return (i&1) ? (i+1) : width; |
|
72 |
case 'dog2': return (i&2) ? (i+1) : width; |
|
73 |
case 'dog3': return (i&3) ? (i+1) : width; |
|
74 |
case 'fray': return (i%2)*width; |
|
75 |
case 'notch': return width; |
|
76 |
case 'bevel': return i+1; |
|
77 |
} |
|
78 |
}; |
|
79 |
|
|
80 |
$.fn.corner = function(o) { |
|
81 |
// in 1.3+ we can fix mistakes with the ready state |
|
82 |
if (this.length == 0) { |
|
83 |
if (!$.isReady && this.selector) { |
|
84 |
var s = this.selector, c = this.context; |
|
85 |
$(function() { |
|
86 |
$(s,c).corner(o); |
|
87 |
}); |
|
88 |
} |
|
89 |
return this; |
|
90 |
} |
|
91 |
|
|
92 |
o = (o||"").toLowerCase(); |
|
93 |
var keep = /keep/.test(o); // keep borders? |
|
94 |
var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]); // corner color |
|
95 |
var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]); // strip color |
|
96 |
var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width |
|
97 |
var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/; |
|
98 |
var fx = ((o.match(re)||['round'])[0]); |
|
99 |
var edges = { T:0, B:1 }; |
|
100 |
var opts = { |
|
101 |
TL: /top|tl/.test(o), TR: /top|tr/.test(o), |
|
102 |
BL: /bottom|bl/.test(o), BR: /bottom|br/.test(o) |
|
103 |
}; |
|
104 |
if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR ) |
|
105 |
opts = { TL:1, TR:1, BL:1, BR:1 }; |
|
106 |
var strip = document.createElement('div'); |
|
107 |
strip.style.overflow = 'hidden'; |
|
108 |
strip.style.height = '1px'; |
|
109 |
strip.style.backgroundColor = sc || 'transparent'; |
|
110 |
strip.style.borderStyle = 'solid'; |
|
111 |
return this.each(function(index){ |
|
112 |
var pad = { |
|
113 |
T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0, |
|
114 |
B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0 |
|
115 |
}; |
|
116 |
|
|
117 |
if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE |
|
118 |
if (!keep) this.style.border = 'none'; |
|
119 |
strip.style.borderColor = cc || gpc(this.parentNode); |
|
120 |
var cssHeight = $.curCSS(this, 'height'); |
|
121 |
|
|
122 |
for (var j in edges) { |
|
123 |
var bot = edges[j]; |
|
124 |
// only add stips if needed |
|
125 |
if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) { |
|
126 |
strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none'); |
|
127 |
var d = document.createElement('div'); |
|
128 |
$(d).addClass('jquery-corner'); |
|
129 |
var ds = d.style; |
|
130 |
|
|
131 |
bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild); |
|
132 |
|
|
133 |
if (bot && cssHeight != 'auto') { |
|
134 |
if ($.css(this,'position') == 'static') |
|
135 |
this.style.position = 'relative'; |
|
136 |
ds.position = 'absolute'; |
|
137 |
ds.bottom = ds.left = ds.padding = ds.margin = '0'; |
|
138 |
if (expr) |
|
139 |
ds.setExpression('width', 'this.parentNode.offsetWidth'); |
|
140 |
else |
|
141 |
ds.width = '100%'; |
|
142 |
} |
|
143 |
else if (!bot && $.browser.msie) { |
|
144 |
if ($.css(this,'position') == 'static') |
|
145 |
this.style.position = 'relative'; |
|
146 |
ds.position = 'absolute'; |
|
147 |
ds.top = ds.left = ds.right = ds.padding = ds.margin = '0'; |
|
148 |
|
|
149 |
// fix ie6 problem when blocked element has a border width |
|
150 |
if (expr) { |
|
151 |
var bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth'); |
|
152 |
ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"'); |
|
153 |
} |
|
154 |
else |
|
155 |
ds.width = '100%'; |
|
156 |
} |
|
157 |
else { |
|
158 |
ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : |
|
159 |
(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px'; |
|
160 |
} |
|
161 |
|
|
162 |
for (var i=0; i < width; i++) { |
|
163 |
var w = Math.max(0,getWidth(fx,i, width)); |
|
164 |
var e = strip.cloneNode(false); |
|
165 |
e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px'; |
|
166 |
bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild); |
|
167 |
} |
|
168 |
} |
|
169 |
} |
|
170 |
}); |
|
171 |
}; |
|
172 |
|
|
173 |
$.fn.uncorner = function() { |
|
174 |
$('div.jquery-corner', this).remove(); |
|
175 |
return this; |
|
176 |
}; |
|
177 |
|
|
178 |
})(jQuery); |
|
0 | 179 |
branches/2.8.x/wb/templates/WbTheme/jquery/jquery-fixedheader.js | ||
---|---|---|
1 |
/** |
|
2 |
* Stupid Fixed Header 1.0.1 - jQuery plugins to create a fixed headers |
|
3 |
* |
|
4 |
* Require: jQuery 1.2.6 |
|
5 |
* Author: Jacky See |
|
6 |
* Blog: http://jacky.seezone.net |
|
7 |
* email: jackysee at gmail dot com |
|
8 |
* Dual licensed under the MIT and GPL licenses: |
|
9 |
* http://www.opensource.org/licenses/mit-license.php |
|
10 |
* http://www.gnu.org/licenses/gpl.html |
|
11 |
*/ |
|
12 |
|
|
13 |
(function($){ |
|
14 |
|
|
15 |
/* created fixed headers , require jquery dimenions plugins*/ |
|
16 |
$.fn.fixedHeader = function(o){ |
|
17 |
var s = {adjustWidth: $.fixedHeader.calcWidth}; |
|
18 |
if(o) $.extend(s,o); |
|
19 |
|
|
20 |
return this.each(function(){ |
|
21 |
var table = $(this); //table |
|
22 |
var tId = this.id; |
|
23 |
|
|
24 |
var scrollBarWidth = $.fixedHeader.getScrollBarWidth(); |
|
25 |
var IE6 = $.browser.msie && $.browser.version == '6.0'; |
|
26 |
|
|
27 |
//wrap a body container |
|
28 |
var bodyContainer = table.wrap('<div></div>').parent() |
|
29 |
.attr('id', tId + "_body_container") |
|
30 |
.css({ |
|
31 |
width: s.width, |
|
32 |
height: s.height, |
|
33 |
overflow: 'auto' |
|
34 |
}); |
|
35 |
|
|
36 |
//Wrap with an overall container |
|
37 |
var tableContainer = bodyContainer.wrap('<div></div>').parent() |
|
38 |
.attr('id', tId + '_table_container') |
|
39 |
.css('position','relative'); |
|
40 |
|
|
41 |
//clone the header |
|
42 |
var headerContainer = $(document.createElement('div')) |
|
43 |
.attr('id', tId + '_header_container') |
|
44 |
.css({ |
|
45 |
width: bodyContainer.innerWidth() - scrollBarWidth, |
|
46 |
height: table.find('thead').outerHeight(), |
|
47 |
overflow: 'hidden', |
|
48 |
top: 0, left:0 |
|
49 |
}) |
|
50 |
.prependTo(tableContainer); |
|
51 |
|
|
52 |
var headerTable = table.clone(true) |
|
53 |
.find('tbody').remove().end() |
|
54 |
.attr('id',tId + "_header") |
|
55 |
.addClass(s.tableClass || table[0].className) |
|
56 |
.css({ |
|
57 |
//width: $.browser.msie? table.outerWidth():table.width(), |
|
58 |
'table-layout':'fixed', |
|
59 |
position:'absolute', |
|
60 |
top:0, left:0 |
|
61 |
}) |
|
62 |
.append(table.find('thead').clone(true)) |
|
63 |
.appendTo(headerContainer); |
|
64 |
|
|
65 |
//sync header width |
|
66 |
var headThs = headerTable.find('th'); |
|
67 |
table.find('th').each(function(i){ |
|
68 |
headThs.eq(i).css('width', s.adjustWidth(this)); |
|
69 |
}) |
|
70 |
|
|
71 |
//sync scroll |
|
72 |
var selects = IE6? table.find("select"): null; |
|
73 |
bodyContainer.scroll(function(){ |
|
74 |
if(IE6 && selects.size()>0){ |
|
75 |
selects.each(function(i){ |
|
76 |
this.style.visibility = |
|
77 |
($(this).offset().top - bodyContainer.offset().top) <= table.find("thead").outerHeight() + 10 |
|
78 |
? 'hidden':'visible'; |
|
79 |
}); |
|
80 |
} |
|
81 |
headerTable.css({ |
|
82 |
left: '-' + $(this).scrollLeft() + 'px' |
|
83 |
}); |
|
84 |
}) |
|
85 |
|
|
86 |
//Move it down |
|
87 |
headerContainer.css({ |
|
88 |
'position': 'absolute', |
|
89 |
'top': 0 |
|
90 |
}); |
|
91 |
}); |
|
92 |
} |
|
93 |
|
|
94 |
$.fixedHeader = { |
|
95 |
calcWidth: function(th){ |
|
96 |
var w = $(th).width(); |
|
97 |
var paddingLeft = $.fixedHeader.getComputedStyleInPx(th,'paddingLeft'); |
|
98 |
var paddingRight = $.fixedHeader.getComputedStyleInPx(th,'paddingRight'); |
|
99 |
var borderWidth = $.fixedHeader.getComputedStyleInPx(th,'borderRightWidth'); |
|
100 |
if($.browser.msie) w = w+borderWidth; |
|
101 |
if($.browser.opera) w = w+borderWidth; |
|
102 |
if($.browser.safari) w = w+paddingLeft+paddingRight+borderWidth*2; |
|
103 |
if($.browser.mozilla && parseFloat($.browser.version) <= 1.8) w=w+borderWidth; //FF2 still got a border-left missing problem, this is the best I can do. |
|
104 |
return w; |
|
105 |
}, |
|
106 |
getComputedStyleInPx: function(elem,style){ |
|
107 |
var computedStyle = (typeof elem.currentStyle != 'undefined') |
|
108 |
?elem.currentStyle |
|
109 |
:document.defaultView.getComputedStyle(elem, null); |
|
110 |
var val = computedStyle[style]; |
|
111 |
val = val? parseInt(val.replace("px","")):0; |
|
112 |
return (!val || val == 'NaN')?0:val; |
|
113 |
}, |
|
114 |
getScrollBarWidth: function() { //calculate or get from global the scroll bar width |
|
115 |
if(!$.fixedHeader.scrollBarWidth){ |
|
116 |
var inner = $(document.createElement('p')).css({width:'100%',height:'100%'}); |
|
117 |
var outer = $(document.createElement('div')) |
|
118 |
.css({ |
|
119 |
position:'absolute', |
|
120 |
top: '0px', |
|
121 |
left: '0px', |
|
122 |
visibility: 'hidden', |
|
123 |
width: '200px', |
|
124 |
height: '150px', |
|
125 |
overflow: 'hidden' |
|
126 |
}) |
|
127 |
.append(inner) |
|
128 |
.appendTo(document.body); |
|
129 |
|
|
130 |
var w1 = inner[0].offsetWidth; |
|
131 |
outer[0].style.overflow = 'scroll'; |
|
132 |
var w2 = inner[0].offsetWidth; |
|
133 |
if (w1 == w2) w2 = outer[0].clientWidth; |
|
134 |
document.body.removeChild (outer[0]); |
|
135 |
$.fixedHeader.scrollBarWidth = (w1 - w2); |
|
136 |
} |
|
137 |
return $.fixedHeader.scrollBarWidth; |
|
138 |
} |
|
139 |
} |
|
140 |
|
|
141 |
})(jQuery); |
|
0 | 142 |
branches/2.8.x/wb/templates/WbTheme/jquery/plugins/jquery-fixedheader.js | ||
---|---|---|
1 |
/** |
|
2 |
* Stupid Fixed Header 1.0.1 - jQuery plugins to create a fixed headers |
|
3 |
* |
|
4 |
* Require: jQuery 1.2.6 |
|
5 |
* Author: Jacky See |
|
6 |
* Blog: http://jacky.seezone.net |
|
7 |
* email: jackysee at gmail dot com |
|
8 |
* Dual licensed under the MIT and GPL licenses: |
|
9 |
* http://www.opensource.org/licenses/mit-license.php |
|
10 |
* http://www.gnu.org/licenses/gpl.html |
|
11 |
*/ |
|
12 |
|
|
13 |
(function($){ |
|
14 |
|
|
15 |
/* created fixed headers , require jquery dimenions plugins*/ |
|
16 |
$.fn.fixedHeader = function(o){ |
|
17 |
var s = {adjustWidth: $.fixedHeader.calcWidth}; |
|
18 |
if(o) $.extend(s,o); |
|
19 |
|
|
20 |
return this.each(function(){ |
|
21 |
var table = $(this); //table |
|
22 |
var tId = this.id; |
|
23 |
|
|
24 |
var scrollBarWidth = $.fixedHeader.getScrollBarWidth(); |
|
25 |
var IE6 = $.browser.msie && $.browser.version == '6.0'; |
|
26 |
|
|
27 |
//wrap a body container |
|
28 |
var bodyContainer = table.wrap('<div></div>').parent() |
|
29 |
.attr('id', tId + "_body_container") |
|
30 |
.css({ |
|
31 |
width: s.width, |
|
32 |
height: s.height, |
|
33 |
overflow: 'auto' |
|
34 |
}); |
|
35 |
|
|
36 |
//Wrap with an overall container |
|
37 |
var tableContainer = bodyContainer.wrap('<div></div>').parent() |
|
38 |
.attr('id', tId + '_table_container') |
|
39 |
.css('position','relative'); |
|
40 |
|
|
41 |
//clone the header |
|
42 |
var headerContainer = $(document.createElement('div')) |
|
43 |
.attr('id', tId + '_header_container') |
|
44 |
.css({ |
|
45 |
width: bodyContainer.innerWidth() - scrollBarWidth, |
|
46 |
height: table.find('thead').outerHeight(), |
|
47 |
overflow: 'hidden', |
|
48 |
top: 0, left:0 |
|
49 |
}) |
|
50 |
.prependTo(tableContainer); |
|
51 |
|
|
52 |
var headerTable = table.clone(true) |
|
53 |
.find('tbody').remove().end() |
|
54 |
.attr('id',tId + "_header") |
|
55 |
.addClass(s.tableClass || table[0].className) |
|
56 |
.css({ |
|
57 |
//width: $.browser.msie? table.outerWidth():table.width(), |
|
58 |
'table-layout':'fixed', |
|
59 |
position:'absolute', |
|
60 |
top:0, left:0 |
|
61 |
}) |
|
62 |
.append(table.find('thead').clone(true)) |
|
63 |
.appendTo(headerContainer); |
|
64 |
|
|
65 |
//sync header width |
|
66 |
var headThs = headerTable.find('th'); |
|
67 |
table.find('th').each(function(i){ |
|
68 |
headThs.eq(i).css('width', s.adjustWidth(this)); |
|
69 |
}) |
|
70 |
|
|
71 |
//sync scroll |
|
72 |
var selects = IE6? table.find("select"): null; |
|
73 |
bodyContainer.scroll(function(){ |
|
74 |
if(IE6 && selects.size()>0){ |
|
75 |
selects.each(function(i){ |
|
76 |
this.style.visibility = |
|
77 |
($(this).offset().top - bodyContainer.offset().top) <= table.find("thead").outerHeight() + 10 |
|
78 |
? 'hidden':'visible'; |
|
79 |
}); |
|
80 |
} |
|
81 |
headerTable.css({ |
|
82 |
left: '-' + $(this).scrollLeft() + 'px' |
|
83 |
}); |
|
84 |
}) |
|
85 |
|
|
86 |
//Move it down |
|
87 |
headerContainer.css({ |
|
88 |
'position': 'absolute', |
|
89 |
'top': 0 |
|
90 |
}); |
|
91 |
}); |
|
92 |
} |
|
93 |
|
|
94 |
$.fixedHeader = { |
|
95 |
calcWidth: function(th){ |
|
96 |
var w = $(th).width(); |
|
97 |
var paddingLeft = $.fixedHeader.getComputedStyleInPx(th,'paddingLeft'); |
|
98 |
var paddingRight = $.fixedHeader.getComputedStyleInPx(th,'paddingRight'); |
|
99 |
var borderWidth = $.fixedHeader.getComputedStyleInPx(th,'borderRightWidth'); |
|
100 |
if($.browser.msie) w = w+borderWidth; |
|
101 |
if($.browser.opera) w = w+borderWidth; |
|
102 |
if($.browser.safari) w = w+paddingLeft+paddingRight+borderWidth*2; |
|
103 |
if($.browser.mozilla && parseFloat($.browser.version) <= 1.8) w=w+borderWidth; //FF2 still got a border-left missing problem, this is the best I can do. |
|
104 |
return w; |
|
105 |
}, |
|
106 |
getComputedStyleInPx: function(elem,style){ |
|
107 |
var computedStyle = (typeof elem.currentStyle != 'undefined') |
|
108 |
?elem.currentStyle |
|
109 |
:document.defaultView.getComputedStyle(elem, null); |
|
110 |
var val = computedStyle[style]; |
|
111 |
val = val? parseInt(val.replace("px","")):0; |
|
112 |
return (!val || val == 'NaN')?0:val; |
|
113 |
}, |
|
114 |
getScrollBarWidth: function() { //calculate or get from global the scroll bar width |
|
115 |
if(!$.fixedHeader.scrollBarWidth){ |
|
116 |
var inner = $(document.createElement('p')).css({width:'100%',height:'100%'}); |
|
117 |
var outer = $(document.createElement('div')) |
|
118 |
.css({ |
|
119 |
position:'absolute', |
|
120 |
top: '0px', |
|
121 |
left: '0px', |
|
122 |
visibility: 'hidden', |
|
123 |
width: '200px', |
|
124 |
height: '150px', |
|
125 |
overflow: 'hidden' |
|
126 |
}) |
|
127 |
.append(inner) |
|
128 |
.appendTo(document.body); |
|
129 |
|
|
130 |
var w1 = inner[0].offsetWidth; |
|
131 |
outer[0].style.overflow = 'scroll'; |
|
132 |
var w2 = inner[0].offsetWidth; |
|
133 |
if (w1 == w2) w2 = outer[0].clientWidth; |
|
134 |
document.body.removeChild (outer[0]); |
|
135 |
$.fixedHeader.scrollBarWidth = (w1 - w2); |
|
136 |
} |
|
137 |
return $.fixedHeader.scrollBarWidth; |
|
138 |
} |
|
139 |
} |
|
140 |
|
|
141 |
})(jQuery); |
|
0 | 142 |
branches/2.8.x/wb/templates/WbTheme/jquery/plugins/jquery-slimbox2.css | ||
---|---|---|
1 |
/* SLIMBOX */ |
|
2 |
|
|
3 |
#lbOverlay { |
|
4 |
position: fixed; |
|
5 |
z-index: 9999; |
|
6 |
left: 0; |
|
7 |
top: 0; |
|
8 |
width: 100%; |
|
9 |
height: 100%; |
|
10 |
background-color: #000; |
|
11 |
cursor: pointer; |
|
12 |
} |
|
13 |
|
|
14 |
#lbCenter, #lbBottomContainer { |
|
15 |
position: absolute; |
|
16 |
z-index: 9999; |
|
17 |
overflow: hidden; |
|
18 |
background-color: #fff; |
|
19 |
} |
|
20 |
|
|
21 |
.lbLoading { |
|
22 |
background: #fff url(images/loading.gif) no-repeat center; |
|
23 |
} |
|
24 |
|
|
25 |
#lbImage { |
|
26 |
position: absolute; |
|
27 |
left: 0; |
|
28 |
top: 0; |
|
29 |
border: 10px solid #fff; |
|
30 |
background-repeat: no-repeat; |
|
31 |
} |
|
32 |
|
|
33 |
#lbPrevLink, #lbNextLink { |
|
34 |
display: block; |
|
35 |
position: absolute; |
|
36 |
top: 0; |
|
37 |
width: 50%; |
|
38 |
outline: none; |
|
39 |
} |
|
40 |
|
|
41 |
#lbPrevLink { |
|
42 |
left: 0; |
|
43 |
} |
|
44 |
|
|
45 |
#lbPrevLink:hover { |
|
46 |
background: transparent url(images/prevlabel.gif) no-repeat 0 15%; |
|
47 |
} |
|
48 |
|
|
49 |
#lbNextLink { |
|
50 |
right: 0; |
|
51 |
} |
|
52 |
|
|
53 |
#lbNextLink:hover { |
|
54 |
background: transparent url(images/nextlabel.gif) no-repeat 100% 15%; |
|
55 |
} |
|
56 |
|
|
57 |
#lbBottom { |
|
58 |
font-family: Verdana, Arial, Geneva, Helvetica, sans-serif; |
|
59 |
font-size: 10px; |
|
60 |
color: #666; |
|
61 |
line-height: 1.4em; |
|
62 |
text-align: left; |
|
63 |
border: 10px solid #fff; |
|
64 |
border-top-style: none; |
|
65 |
} |
|
66 |
|
|
67 |
#lbCloseLink { |
|
68 |
display: block; |
|
69 |
float: right; |
|
70 |
width: 66px; |
|
71 |
height: 22px; |
|
72 |
background: transparent url(images/closelabel.gif) no-repeat center; |
|
73 |
margin: 5px 0; |
|
74 |
outline: none; |
|
75 |
} |
|
76 |
|
|
77 |
#lbCaption, #lbNumber { |
|
78 |
margin-right: 71px; |
|
79 |
} |
|
80 |
|
|
81 |
#lbCaption { |
|
82 |
font-weight: bold; |
|
83 |
} |
|
0 | 84 |
branches/2.8.x/wb/templates/WbTheme/jquery/plugins/jquery.dropshadow.js | ||
---|---|---|
1 |
/* |
|
2 |
VERSION: Drop Shadow jQuery Plugin 1.6 12-13-2007 |
|
3 |
|
|
4 |
REQUIRES: jquery.js (1.2.6 or later) |
|
5 |
|
|
6 |
SYNTAX: $(selector).dropShadow(options); // Creates new drop shadows |
|
7 |
$(selector).redrawShadow(); // Redraws shadows on elements |
|
8 |
$(selector).removeShadow(); // Removes shadows from elements |
|
9 |
$(selector).shadowId(); // Returns an existing shadow's ID |
|
10 |
|
|
11 |
OPTIONS: |
|
12 |
|
|
13 |
left : integer (default = 4) |
|
14 |
top : integer (default = 4) |
|
15 |
blur : integer (default = 2) |
|
16 |
opacity : decimal (default = 0.5) |
|
17 |
color : string (default = "black") |
|
18 |
swap : boolean (default = false) |
|
19 |
|
|
20 |
The left and top parameters specify the distance and direction, in pixels, to |
|
21 |
offset the shadow. Zero values position the shadow directly behind the element. |
|
22 |
Positive values shift the shadow to the right and down, while negative values |
|
23 |
shift the shadow to the left and up. |
|
24 |
|
|
25 |
The blur parameter specifies the spread, or dispersion, of the shadow. Zero |
|
26 |
produces a sharp shadow, one or two produces a normal shadow, and three or four |
|
27 |
produces a softer shadow. Higher values increase the processing load. |
|
28 |
|
|
29 |
The opacity parameter should be a decimal value, usually less than one. You can |
|
30 |
use a value higher than one in special situations, e.g. with extreme blurring. |
|
31 |
|
|
32 |
Color is specified in the usual manner, with a color name or hex value. The |
|
33 |
color parameter does not apply with transparent images. |
|
34 |
|
|
35 |
The swap parameter reverses the stacking order of the original and the shadow. |
|
36 |
This can be used for special effects, like an embossed or engraved look. |
|
37 |
|
|
38 |
EXPLANATION: |
|
39 |
|
|
40 |
This jQuery plug-in adds soft drop shadows behind page elements. It is only |
|
41 |
intended for adding a few drop shadows to mostly stationary objects, like a |
|
42 |
page heading, a photo, or content containers. |
|
43 |
|
|
44 |
The shadows it creates are not bound to the original elements, so they won't |
|
45 |
move or change size automatically if the original elements change. A window |
|
46 |
resize event listener is assigned, which should re-align the shadows in many |
|
47 |
cases, but if the elements otherwise move or resize you will have to handle |
|
48 |
those events manually. Shadows can be redrawn with the redrawShadow() method |
|
49 |
or removed with the removeShadow() method. The redrawShadow() method uses the |
|
50 |
same options used to create the original shadow. If you want to change the |
|
51 |
options, you should remove the shadow first and then create a new shadow. |
|
52 |
|
|
53 |
The dropShadow method returns a jQuery collection of the new shadow(s). If |
|
54 |
further manipulation is required, you can store it in a variable like this: |
|
55 |
|
|
56 |
var myShadow = $("#myElement").dropShadow(); |
|
57 |
|
|
58 |
You can also read the ID of the shadow from the original element at a later |
|
59 |
time. To get a shadow's ID, either read the shadowId attribute of the |
|
60 |
original element or call the shadowId() method. For example: |
|
61 |
|
|
62 |
var myShadowId = $("#myElement").attr("shadowId"); or |
|
63 |
var myShadowId = $("#myElement").shadowId(); |
|
64 |
|
|
65 |
If the original element does not already have an ID assigned, a random ID will |
|
66 |
be generated for the shadow. However, if the original does have an ID, the |
|
67 |
shadow's ID will be the original ID and "_dropShadow". For example, if the |
|
68 |
element's ID is "myElement", the shadow's ID would be "myElement_dropShadow". |
|
69 |
|
|
70 |
If you have a long piece of text and the user resizes the window so that the |
|
71 |
text wraps or unwraps, the shape of the text changes and the words are no |
|
72 |
longer in the same positions. In that case, you can either preset the height |
|
73 |
and width, so that it becomes a fixed box, or you can shadow each word |
|
74 |
separately, like this: |
|
75 |
|
|
76 |
<h1><span>Your</span> <span>Page</span> <span>Title</span></h1> |
|
77 |
|
|
78 |
$("h1 span").dropShadow(); |
|
79 |
|
|
80 |
The dropShadow method attempts to determine whether the selected elements have |
|
81 |
transparent backgrounds. If you want to shadow the content inside an element, |
|
82 |
like text or a transparent image, it must not have a background-color or |
|
83 |
background-image style. If the element has a solid background it will create a |
|
84 |
rectangular shadow around the outside box. |
|
85 |
|
|
86 |
The shadow elements are positioned absolutely one layer below the original |
|
87 |
element, which is positioned relatively (unless it's already absolute). |
|
88 |
|
|
89 |
*** All shadows have the "dropShadow" class, for selecting with CSS or jQuery. |
|
90 |
|
|
91 |
ISSUES: |
|
92 |
|
|
93 |
1) Limited styling of shadowed elements by ID. Because IDs must be unique, |
|
94 |
and the shadows have their own ID, styles applied by ID won't transfer |
|
95 |
to the shadows. Instead, style elements by class or use inline styles. |
|
96 |
2) Sometimes shadows don't align properly. Elements may need to be wrapped |
|
97 |
in container elements, margins or floats changed, etc. or you may just |
|
98 |
have to tweak the left and top offsets to get them to align. For example, |
|
99 |
with draggable objects, you have to wrap them inside two divs. Make the |
|
100 |
outer div draggable and set the inner div's position to relative. Then |
|
101 |
you can create a shadow on the element inside the inner div. |
|
102 |
3) If the user changes font sizes it will throw the shadows off. Browsers |
|
103 |
do not expose an event for font size changes. The only known way to |
|
104 |
detect a user font size change is to embed an invisible text element and |
|
105 |
then continuously poll for changes in size. |
|
106 |
4) Safari support is shaky, and may require even more tweaks/wrappers, etc. |
|
107 |
|
|
108 |
The bottom line is that this is a gimick effect, not PFM, and if you push it |
|
109 |
too hard or expect it to work in every possible situation on every browser, |
|
110 |
you will be disappointed. Use it sparingly, and don't use it for anything |
|
111 |
critical. Otherwise, have fun with it! |
|
112 |
|
|
113 |
AUTHOR: Larry Stevens (McLars@eyebulb.com) This work is in the public domain, |
|
114 |
and it is not supported in any way. Use it at your own risk. |
|
115 |
*/ |
|
116 |
|
|
117 |
|
|
118 |
(function($){ |
|
119 |
|
|
120 |
var dropShadowZindex = 1; //z-index counter |
|
121 |
|
|
122 |
$.fn.dropShadow = function(options) |
|
123 |
{ |
|
124 |
// Default options |
|
125 |
var opt = $.extend({ |
|
126 |
left: 4, |
|
127 |
top: 4, |
|
128 |
blur: 2, |
|
129 |
opacity: .5, |
|
130 |
color: "black", |
|
131 |
swap: false |
|
132 |
}, options); |
|
133 |
var jShadows = $([]); //empty jQuery collection |
|
134 |
|
|
135 |
// Loop through original elements |
|
136 |
this.not(".dropShadow").each(function() |
|
137 |
{ |
|
138 |
var jthis = $(this); |
|
139 |
var shadows = []; |
|
140 |
var blur = (opt.blur <= 0) ? 0 : opt.blur; |
|
141 |
var opacity = (blur == 0) ? opt.opacity : opt.opacity / (blur * 8); |
|
142 |
var zOriginal = (opt.swap) ? dropShadowZindex : dropShadowZindex + 1; |
|
143 |
var zShadow = (opt.swap) ? dropShadowZindex + 1 : dropShadowZindex; |
|
144 |
|
|
145 |
// Create ID for shadow |
|
146 |
var shadowId; |
|
147 |
if (this.id) { |
|
148 |
shadowId = this.id + "_dropShadow"; |
|
149 |
} |
|
150 |
else { |
|
151 |
shadowId = "ds" + (1 + Math.floor(9999 * Math.random())); |
|
152 |
} |
|
153 |
|
|
154 |
// Modify original element |
|
155 |
$.data(this, "shadowId", shadowId); //store id in expando |
|
156 |
$.data(this, "shadowOptions", options); //store options in expando |
|
157 |
jthis |
|
158 |
.attr("shadowId", shadowId) |
|
159 |
.css("zIndex", zOriginal); |
|
160 |
if (jthis.css("position") != "absolute") { |
|
161 |
jthis.css({ |
|
162 |
position: "relative", |
|
163 |
zoom: 1 //for IE layout |
|
164 |
}); |
|
165 |
} |
|
166 |
|
|
167 |
// Create first shadow layer |
|
168 |
bgColor = jthis.css("backgroundColor"); |
|
169 |
if (bgColor == "rgba(0, 0, 0, 0)") bgColor = "transparent"; //Safari |
|
170 |
if (bgColor != "transparent" || jthis.css("backgroundImage") != "none" |
|
171 |
|| this.nodeName == "SELECT" |
|
172 |
|| this.nodeName == "INPUT" |
|
173 |
|| this.nodeName == "TEXTAREA") { |
|
174 |
shadows[0] = $("<div></div>") |
|
175 |
.css("background", opt.color); |
|
176 |
} |
|
177 |
else { |
|
178 |
shadows[0] = jthis |
|
179 |
.clone() |
|
180 |
.removeAttr("id") |
|
181 |
.removeAttr("name") |
|
182 |
.removeAttr("shadowId") |
|
183 |
.css("color", opt.color); |
|
184 |
} |
|
185 |
shadows[0] |
|
186 |
.addClass("dropShadow") |
|
187 |
.css({ |
|
188 |
height: jthis.outerHeight(), |
|
189 |
left: blur, |
|
190 |
opacity: opacity, |
|
191 |
position: "absolute", |
|
192 |
top: blur, |
|
193 |
width: jthis.outerWidth(), |
|
194 |
zIndex: zShadow |
|
195 |
}); |
|
196 |
|
|
197 |
// Create other shadow layers |
|
198 |
var layers = (8 * blur) + 1; |
|
199 |
for (i = 1; i < layers; i++) { |
|
200 |
shadows[i] = shadows[0].clone(); |
|
201 |
} |
|
202 |
|
|
203 |
// Position layers |
|
204 |
var i = 1; |
|
205 |
var j = blur; |
|
206 |
while (j > 0) { |
|
207 |
shadows[i].css({left: j * 2, top: 0}); //top |
|
208 |
shadows[i + 1].css({left: j * 4, top: j * 2}); //right |
|
209 |
shadows[i + 2].css({left: j * 2, top: j * 4}); //bottom |
|
210 |
shadows[i + 3].css({left: 0, top: j * 2}); //left |
|
211 |
shadows[i + 4].css({left: j * 3, top: j}); //top-right |
|
212 |
shadows[i + 5].css({left: j * 3, top: j * 3}); //bottom-right |
|
213 |
shadows[i + 6].css({left: j, top: j * 3}); //bottom-left |
|
214 |
shadows[i + 7].css({left: j, top: j}); //top-left |
|
215 |
i += 8; |
|
216 |
j--; |
|
217 |
} |
|
218 |
|
|
219 |
// Create container |
|
220 |
var divShadow = $("<div></div>") |
|
221 |
.attr("id", shadowId) |
|
222 |
.addClass("dropShadow") |
|
223 |
.css({ |
|
224 |
left: jthis.position().left + opt.left - blur, |
|
225 |
marginTop: jthis.css("marginTop"), |
|
226 |
marginRight: jthis.css("marginRight"), |
|
227 |
marginBottom: jthis.css("marginBottom"), |
|
228 |
marginLeft: jthis.css("marginLeft"), |
|
229 |
position: "absolute", |
|
230 |
top: jthis.position().top + opt.top - blur, |
|
231 |
zIndex: zShadow |
|
232 |
}); |
|
233 |
|
|
234 |
// Add layers to container |
|
235 |
for (i = 0; i < layers; i++) { |
|
236 |
divShadow.append(shadows[i]); |
|
237 |
} |
|
238 |
|
|
239 |
// Add container to DOM |
|
240 |
jthis.after(divShadow); |
|
241 |
|
|
242 |
// Add shadow to return set |
|
243 |
jShadows = jShadows.add(divShadow); |
|
244 |
|
|
245 |
// Re-align shadow on window resize |
|
246 |
$(window).resize(function() |
|
247 |
{ |
|
248 |
try { |
|
249 |
divShadow.css({ |
|
250 |
left: jthis.position().left + opt.left - blur, |
|
251 |
top: jthis.position().top + opt.top - blur |
|
252 |
}); |
|
253 |
} |
|
254 |
catch(e){} |
|
255 |
}); |
|
256 |
|
|
257 |
// Increment z-index counter |
|
258 |
dropShadowZindex += 2; |
|
259 |
|
|
260 |
}); //end each |
|
261 |
|
|
262 |
return this.pushStack(jShadows); |
|
263 |
}; |
|
264 |
|
|
265 |
|
|
266 |
$.fn.redrawShadow = function() |
|
267 |
{ |
|
268 |
// Remove existing shadows |
|
269 |
this.removeShadow(); |
|
270 |
|
|
271 |
// Draw new shadows |
|
272 |
return this.each(function() |
|
273 |
{ |
|
274 |
var shadowOptions = $.data(this, "shadowOptions"); |
|
275 |
$(this).dropShadow(shadowOptions); |
|
276 |
}); |
|
277 |
}; |
|
278 |
|
|
279 |
|
|
280 |
$.fn.removeShadow = function() |
|
281 |
{ |
|
282 |
return this.each(function() |
|
283 |
{ |
|
284 |
var shadowId = $(this).shadowId(); |
|
285 |
$("div#" + shadowId).remove(); |
|
286 |
}); |
|
287 |
}; |
|
288 |
|
|
289 |
|
|
290 |
$.fn.shadowId = function() |
|
291 |
{ |
|
292 |
return $.data(this[0], "shadowId"); |
|
293 |
}; |
|
294 |
|
|
295 |
|
|
296 |
$(function() |
|
297 |
{ |
|
298 |
// Suppress printing of shadows |
|
299 |
var noPrint = "<style type='text/css' media='print'>"; |
|
300 |
noPrint += ".dropShadow{visibility:hidden;}</style>"; |
|
301 |
$("head").append(noPrint); |
|
302 |
}); |
|
303 |
|
|
304 |
})(jQuery); |
|
0 | 305 |
Also available in: Unified diff
- templates/argos_theme
- templates/allcss
- templates/wb_theme
+ templates/WbTheme
! all upgrade/install and all other files needed to change defaults