Changeset 201

Show
Ignore:
Timestamp:
02/01/08 20:09:00 (5 years ago)
Author:
d0nut
Message:

works for scaling between other colorrange

Location:
taggingreloaded
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • taggingreloaded/files/js/TaggingReloaded.class.js

    r78 r201  
    2222        var limitmin = 70; 
    2323        var limitmax = 200; 
     24        var black = true; 
    2425 
    2526        // position of the object which got clicked and is ready for drag and drop 
     
    3738                limitmin = min; 
    3839                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; 
    3948        } 
    4049         
     
    226235                var Ausdruck = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/; 
    227236                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                } 
    232248        } 
    233249 
  • taggingreloaded/files/lib/util/TaggingReloadedUtil.class.php

    r180 r201  
    1111        protected static $stopwordList; 
    1212        protected static $systemTaggerUserID = 0; // unsigned int 
     13        protected static $black = true; 
    1314 
    1415        /** 
     
    134135         
    135136        /** 
     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        /** 
    136145         * beautify tags with size and color 
    137146         * @param tags 
     
    141150         */ 
    142151        public static function beautify($tags, $forced_minsize=null, $forced_maxsize=null) { 
    143                 // TODO: auslagern 
    144152                $minsize = $forced_minsize === null ? 75 : $forced_minsize; 
    145153                $maxsize = $forced_maxsize === null ? 275 : $forced_maxsize; 
     
    169177                        $key = strtolower($key); 
    170178                        $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                        } 
    172183                         
    173184                        $tmp[$key] = $tag; 
  • taggingreloaded/package.xml

    r187 r201  
    4242         
    4343        <instructions type="update" fromversion="0.7.0"> 
     44                <files>files.tar</files> 
     45                <templates>templates.tar</templates> 
    4446                <script>update.php</script> 
    4547                <useroptions>useroptions.xml</useroptions> 
  • taggingreloaded/templates/messageFormTaggingReloaded.tpl

    r98 r201  
    1010                var tagging = new TaggingReloaded(taggingdom); 
    1111                tagging.setLimits(30,500); 
     12                {if false}tagging.setBlack(false);{/if} 
    1213        //]]> 
    1314        </script>