Changeset 201
- Timestamp:
- 02/01/08 20:09:00 (5 years ago)
- Location:
- taggingreloaded
- Files:
-
- 4 modified
-
files/js/TaggingReloaded.class.js (modified) (3 diffs)
-
files/lib/util/TaggingReloadedUtil.class.php (modified) (4 diffs)
-
package.xml (modified) (1 diff)
-
templates/messageFormTaggingReloaded.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
taggingreloaded/files/js/TaggingReloaded.class.js
r78 r201 22 22 var limitmin = 70; 23 23 var limitmax = 200; 24 var black = true; 24 25 25 26 // position of the object which got clicked and is ready for drag and drop … … 37 38 limitmin = min; 38 39 limitmax = max; 40 } 41 42 /** 43 * sets color 44 * @param choice boolean set to true if color should be white 45 */ 46 this.setBlack = function(choice) { 47 black = choice; 39 48 } 40 49 … … 226 235 var Ausdruck = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/; 227 236 Ausdruck.exec(val); 228 var r = parseInt(RegExp.$1)-5; 229 var g = parseInt(RegExp.$2)-5; 230 var b = parseInt(RegExp.$3)-5; 231 return 'rgb('+(r>0?r:0)+','+(g>0?g:0)+','+(b>0?b:0)+')'; 237 if(black) { 238 var r = parseInt(RegExp.$1)-5; 239 var g = parseInt(RegExp.$2)-5; 240 var b = parseInt(RegExp.$3)-5; 241 return 'rgb('+(r>0?r:0)+','+(g>0?g:0)+','+(b>0?b:0)+')'; 242 } else { 243 var r = parseInt(RegExp.$1)+5; 244 var g = parseInt(RegExp.$2)+5; 245 var b = parseInt(RegExp.$3)+5; 246 return 'rgb('+(r<255?r:255)+','+(g<255?g:255)+','+(b<255?b:255)+')'; 247 } 232 248 } 233 249 -
taggingreloaded/files/lib/util/TaggingReloadedUtil.class.php
r180 r201 11 11 protected static $stopwordList; 12 12 protected static $systemTaggerUserID = 0; // unsigned int 13 protected static $black = true; 13 14 14 15 /** … … 134 135 135 136 /** 137 * sets color 138 * @param choice boolean set to true if color should be white 139 */ 140 public static function setBlack($choice) { 141 self::$black = $choice; 142 } 143 144 /** 136 145 * beautify tags with size and color 137 146 * @param tags … … 141 150 */ 142 151 public static function beautify($tags, $forced_minsize=null, $forced_maxsize=null) { 143 // TODO: auslagern144 152 $minsize = $forced_minsize === null ? 75 : $forced_minsize; 145 153 $maxsize = $forced_maxsize === null ? 275 : $forced_maxsize; … … 169 177 $key = strtolower($key); 170 178 $size = ($tag['weight'] * ($maxsize-$minsize) / ($max-$min) )+$b; 171 $color = 255 - (($tag['weight'] * ($maxcolor-$mincolor) / ($max-$min) )+$c); 179 $color = ($tag['weight'] * ($maxcolor-$mincolor) / ($max-$min) )+$c; 180 if(self::$black) { 181 $color = 255 - $color; 182 } 172 183 173 184 $tmp[$key] = $tag; -
taggingreloaded/package.xml
r187 r201 42 42 43 43 <instructions type="update" fromversion="0.7.0"> 44 <files>files.tar</files> 45 <templates>templates.tar</templates> 44 46 <script>update.php</script> 45 47 <useroptions>useroptions.xml</useroptions> -
taggingreloaded/templates/messageFormTaggingReloaded.tpl
r98 r201 10 10 var tagging = new TaggingReloaded(taggingdom); 11 11 tagging.setLimits(30,500); 12 {if false}tagging.setBlack(false);{/if} 12 13 //]]> 13 14 </script>
