Rezultati 1 do 3 od 3






  1. #1
    Banovan
    Datum registracije
    24.12.2012
    Postovi
    3.778
    Sviđanja / Nesviđanja
    Zahvali
    7.125
    Pohvaljen 8.714 puta u 5.181 postova
    Moć reputacije
    0

    Javaskript bla bla?

    Imam iritirajuću situaciju sa sidebar gadgetima.

    Razmak između ovog za kontrolu zvuka i ostalih je prevelik, kako to da smanjim?






    Sa gornje strane je ok:



    Gadget.js



    var sound;
    var t;
    var vol;
    var mute;
    var updating = false;

    function init()
    {
    background.addShadow("black", 2, 50, 1, 1);
    objectHolder.innerHTML += "<OBJECT ID=\"Volume\" style=\"width: 0px; height: 0px;\" CLASSID=\"CLSID:052DB226-BE3B-44D4-B932-9C8049B2110B\"></OBJECT>";
    Volume.SetVolumeChangeCallback(window, "onVolumeChanged");
    updateMute(Volume.GetMute());
    updateVolume(Volume.GetVolume());

    sound = GetLibrary();
    t = setInterval("refreshdisplay()",60);

    }

    function terminate()
    {
    UnregisterLibrary();
    }

    function onVolumeChanged(m, v)
    {
    updateMute(m);
    updateVolume(v);
    }

    function mouseDown()
    {
    if(event.x > vol2.offsetLeft && event.x < vol2.offsetLeft + vol2.offsetWidth &&
    event.y > vol2.offsetTop && event.y < vol2.offsetTop + vol2.offsetHeight)
    {
    updateVolume(null);
    volumeDrag = true;
    }
    else if(event.x > 3 && event.x < 19 + mute2.offsetWidth &&
    event.y > 3 && event.y < 14 + mute2.offsetHeight)
    {
    updateMute(null);
    }
    if(event.button == 4)
    {
    sound.MasterMute = !sound.MasterMute;
    }
    }

    function mouseUp()
    {
    volumeDrag = false;
    }

    function mouseMove()
    {
    if(volumeDrag)
    {
    if(!(event.x > vol2.offsetLeft && event.x < vol2.offsetLeft + vol2.offsetWidth &&
    event.y > vol2.offsetTop && event.y < vol2.offsetTop + vol2.offsetHeight))
    {
    volumeDrag = false;
    return;
    }
    updateVolume(null);
    }
    }

    function updateMute(m)
    {
    var muted;
    if(m == null)
    {
    muted = !(mute2.style.display == "block");
    Volume.SetMute(muted ? 1 : 0);
    }
    else
    {
    muted = (m == "1");
    }
    mute2.style.display = muted ? "block" : "none";
    }

    function updateVolume(v)
    {
    var volLeft = vol2.offsetLeft;
    var volRight = volLeft + vol2.offsetWidth;
    var pos;
    if(v == undefined)
    {
    if(!event ||
    event.x < volLeft ||
    event.x > volRight)
    {
    return;
    }
    pos = event.x - volLeft;
    Volume.SetVolume(pos / (volRight - volLeft));
    }
    else
    {
    pos = (volRight - volLeft) * parseFloat(v);
    }
    var volHeight = vol2.offsetHeight;
    vol2.style.clip = "rect(" + 0 + "px," + pos + "px," + volHeight + "px," + 0 + "px)";
    }

    function changeVolume()
    {
    var v = sound.MasterVolume;

    if (event.wheelDelta >= 20)
    v += 3;
    else
    v -= 3;

    if (v >= 100) v = 100;
    if (v <= 0) v = 0;

    sound.MasterVolume = v;
    }

    function runMixer()
    {
    System.Shell.execute("sndvol.exe");
    }

    function refreshdisplay()
    {
    try
    {
    updating = true;

    vol = sound.MasterVolume;
    mute = sound.MasterMute;

    if (mute)
    txtVolume.innerText = " Mute";
    else
    txtVolume.innerText ="Volume - " + vol + "%";


    divpeakleft.style.width = (Math.round((sound.LeftPeak / 4)) * 5);
    divpeakright.style.width = (Math.round((sound.RightPeak / 4)) * 5);

    updating = false;
    }
    catch(err)
    {
    }
    }




    Regunreg.js


    // ################## CONFIGURATION ###################
    var dllCLSID = "{71B1723C-1EC2-4b4d-868E-FA58C7F95CD9}";
    var Classname = "SoundControl.SoundControlGadget";
    var LibPath = "file:///" + System.Gadget.path.replace(new RegExp("\\\\", "g"), "/") + "/dlls/volumecontrol.dll"
    var LibName = "SoundControl";
    // ################################################## ##

    // Gloabal Vars
    var oShell = new ActiveXObject("WScript.Shell");
    var regRoot;

    // is debugging ?
    var dbg = new ActiveXObject("Scripting.FileSystemObject");
    var bDebug = dbg.FileExists(System.Gadget.path+"\\debug.txt");

    InitializeInterop();

    var volumeDrag = false;

    function InitializeInterop()
    {
    if(!InteropRegistered())
    {
    try
    {
    Register("HKCR\\");
    }
    catch(e)
    {
    try
    {
    Register("HKCU\\Software\\Classes\\");
    }
    catch(e)
    {
    }
    }
    }
    }

    function InteropRegistered()
    {
    try
    {
    var proxy = new ActiveXObject("VolumeControl.Volume");
    proxy = null;
    return true;
    }
    catch (e)
    {
    return false;
    }
    }

    function Register(root)
    {
    var codeBase;
    var sysString;
    if(System.Machine.processorArchitecture.indexOf("6 4") != -1)
    {
    sysString = "win64";
    codeBase = System.Gadget.path + "\\dlls\\VolumeControl64.dll";
    }
    else
    {
    sysString = "win32";
    codeBase = System.Gadget.path + "\\dlls\\VolumeControl32.dll";
    }

    shell = new ActiveXObject("WScript.Shell");

    shell.RegWrite(root + "VolumeControl.Volume\\", "Volume Class");
    shell.RegWrite(root + "VolumeControl.Volume\\CLSID\\", "{052DB226-BE3B-44D4-B932-9C8049B2110B}");
    shell.RegWrite(root + "VolumeControl.Volume\\CurVer\\", "VolumeControl.Volume.1");
    shell.RegWrite(root + "VolumeControl.Volume.1\\", "Volume Class");
    shell.RegWrite(root + "VolumeControl.Volume.1\\CLSID\\", "{052DB226-BE3B-44D4-B932-9C8049B2110B}");

    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\", "VolumeControlLib.Volume");
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\InprocServer32\\", codeBase);
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\InprocServer32\\ThreadingModel", "Single");
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\ProgId\\", "VolumeControl.Volume.1");
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\TypeLib\\", "{B42D74B7-6189-43E4-9659-8C9850FF9061}");
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\VersionIndependentProgID\\", "VolumeControl.Volume");
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\MiscStatus\\", "0");
    shell.RegWrite(root + "CLSID\\{052DB226-BE3B-44D4-B932-9C8049B2110B}\\MiscStatus\\1\\", "131473");

    shell.RegWrite(root + "TypeLib\\{B42D74B7-6189-43E4-9659-8C9850FF9061}\\1.0\\", "VolumeControl 1.0 Type Library");
    shell.RegWrite(root + "TypeLib\\{B42D74B7-6189-43E4-9659-8C9850FF9061}\\1.0\\0\\" + sysString + "\\", codeBase);
    shell.RegWrite(root + "TypeLib\\{B42D74B7-6189-43E4-9659-8C9850FF9061}\\1.0\\FLAGS\\", "0");
    shell.RegWrite(root + "TypeLib\\{B42D74B7-6189-43E4-9659-8C9850FF9061}\\1.0\\HELPDIR\\", "");
    }

    // Debuglog
    function debugLog(str)
    {
    try
    {
    if (bDebug)
    {
    var oFSO = new ActiveXObject("Scripting.FileSystemObject");
    var iFlag = 2;
    if (str != "")
    iFlag = 8;

    var debugLogFile = oFSO.OpenTextFile(System.Gadget.path+"\\debug.txt" , iFlag);
    debugLogFile.WriteLine(new Date().toLocaleString() + ": " + str);
    debugLogFile.Close();
    debugLogFile = null;
    }
    }
    catch(err)
    {
    }
    }

    // Register ActiveX component
    function RegisterLibrary()
    {
    debugLog("RegisterLibrary:" + Classname);
    var classRoot = regRoot + "\\Software\\Classes\\"+Classname+"\\";
    var clsidRoot = regRoot + "\\Software\\Classes\\CLSID\\" + dllCLSID + "\\";

    try
    {
    oShell.RegWrite(classRoot,Classname, "REG_SZ");
    oShell.RegWrite(classRoot + "CLSID\\", dllCLSID, "REG_SZ");
    oShell.RegWrite(clsidRoot, Classname, "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\", "mscoree.dll", "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\ThreadingModel", "Both", "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\Class", Classname, "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\Assembly", LibName + ", Version=1.0.2588.9125, Culture=neutral, PublicKeyToken=null", "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\RuntimeVersion", "v2.0.50727", "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\CodeBase", LibPath , "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\1.0.2588.9125\\Class", Classname, "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\1.0.2588.9125\\Assembly", LibName + ", Version=1.0.2588.9125, Culture=neutral, PublicKeyToken=null", "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\1.0.2588.9125\\RuntimeVersion ", "v2.0.50727", "REG_SZ");
    oShell.RegWrite(clsidRoot + "InprocServer32\\1.0.2588.9125\\CodeBase", LibPath , "REG_SZ");
    oShell.RegWrite(clsidRoot + "ProgId\\", Classname , "REG_SZ");
    oShell.RegWrite(clsidRoot + "ProgId\\Implemented Categories\\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}\\", "", "REG_SZ");
    }
    catch(err)
    {
    debugLog("RegisterLibrary: "+err.name+" - "+err.message)
    }
    }

    // Unregister ActiveX component
    function UnregisterLibrary()
    {
    debugLog("UnregisterLibrary:" + Classname);
    var classRoot = regRoot + "\\Software\\Classes\\"+Classname+"\\";
    var clsidRoot = regRoot + "\\Software\\Classes\\CLSID\\" + dllCLSID + "\\";

    try
    {
    oShell.RegDelete(clsidRoot + "ProgId\\Implemented Categories\\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}\\");
    oShell.RegDelete(clsidRoot + "ProgId\\Implemented Categories\\");
    oShell.RegDelete(clsidRoot + "ProgId\\");
    oShell.RegDelete(clsidRoot + "InprocServer32\\1.0.2588.9125\\");
    oShell.RegDelete(clsidRoot + "InprocServer32\\");
    oShell.RegDelete(clsidRoot);
    oShell.RegDelete(classRoot + "CLSID\\");
    oShell.RegDelete(classRoot);
    }
    catch(err)
    {
    debugLog("UnregisterLibrary: "+err.name+" - "+err.message);
    }
    }

    // Try to Register the Library
    function ActivateLibrary(root)
    {
    debugLog("ActivateLibrary:" + root);
    regRoot = root;
    try
    {

    RegisterLibrary();
    debugLog("ReturnLibrary");
    return new ActiveXObject(Classname);
    }
    catch(err)
    {
    debugLog("ActivateLibrary: "+err.name+" - "+err.message);
    UnregisterLibrary();
    return null;
    }
    }

    function GetLibrary()
    {
    debugLog("Register ActiveX");
    var Lib;

    // If UAC enabled registering to HKCU
    Lib = ActivateLibrary("HKCU");

    // If UAC disabled registering to HKLM
    if (Lib == null)
    Lib = ActivateLibrary("HKLM");

    if (Lib == null)
    debugLog("Error creating ActiveX object");
    else
    return Lib;
    }




    Gadget.html


    <html>

    <head>

    <link type="text/css" rel="stylesheet" href="styles/gadget.css"/>

    <script type="text/javascript" language="javascript" src="scripts/gadget.js"></script>
    <script type="text/javascript" language="javascript" src="scripts/regunreg.js"></script>

    </head>

    <body onload="init();" onunload="terminate();" onmousedown="mouseDown();" onmouseup="mouseUp();" onmousemove="mouseMove();" onmousewheel="changeVolume();" ondblclick="runMixer();">

    <div id="objectHolder"></div>

    <g:background src="images\background.png" id="background" class="back" />

    <div id="vol2" class="volumeBox">
    <img src="images\volume.png" />
    </div>

    <div id="mute2" class="muteBox">
    <img src="images\muted.png" />
    </div>

    <div id="txtVolume" class="levelBox"></div>

    <img class="peakbackleft" src="images\peakback.png" />

    <div id="divpeakleft" class="peakleft">
    <img id="peakleft" src="images\peak.png" />
    </div>

    <img class="peakbackright" src="images\peakback.png" />

    <div id="divpeakright" class="peakright">
    <img id="peakright" src="images\peak.png" />
    </div>

    <div style="position: absolute; top: 0px; left: 0px" id="debug"></div>

    </body>

    </html>




    Gadget.xml


    <?xml version="1.0" encoding="utf-8" ?>
    <gadget>
    <name>PlaceboVolume Control</name>
    <namespace>soundcontrol</namespace>
    <namespace>indev.gadgets</namespace>
    <version>1.0</version>
    <author name="DMN">
    <info url="http://www.codeoneteam.com" text="codeoneteam.com"/>
    <logo src="logo.png"/>
    </author>
    <copyright>CODEONETEAM</copyright>
    <description>Intended for adjusting volume level of the system, temporal mute of sound, reflections level of signal in real time and call volume mixer.</description>
    <icons>
    <icon src="icon.png"/>
    </icons>
    <hosts>
    <host name="sidebar">
    <base type="html" apiVersion="1.0.0" src="gadget.html" />
    <permissions>Full</permissions>
    <platform minPlatformVersion="0.3" />
    <defaultImage src="drag.png"/>
    </host>
    </hosts>
    </gadget>




    Gadget.css


    body
    {
    font-family: Calibri;
    margin: 0px;
    padding: 0px;
    width: 130px;
    height: 54px;
    }

    .back
    {
    position: absolute;
    width: 130px;
    height: 54px;
    z-index: -1;
    }

    .muteBox
    {
    position: absolute;
    left: 8;
    top: 7;
    display: none;
    }

    .levelBox
    {
    position: absolute;
    left: 40px;
    top: 5px;
    color: #e9e9e9;
    text-shadow: 2px 2px 3px # 000;
    font-size: 9px;
    font-weight: bold;
    font-family: 'Segoe UI';

    }


    .volumeBox
    {
    position: absolute;
    left: 23;
    top: 2;
    }

    .peakbackleft
    {
    position: absolute;
    left: 6px;
    top: 17px;
    }

    .peakbackright
    {
    position: absolute;
    left: 6px;
    top: 30px;
    }

    .peakleft
    {
    position: absolute;
    overflow: hidden;
    width: 117px;
    left: 6px;
    top: 17px;
    }

    .peakright
    {
    position: absolute;
    overflow: hidden;
    width: 117px;
    left: 6px;
    top: 30px;
    }

    Izmenjeno od: Vule; 07.03.2017 u 12:19.

  2. #2
    Banovan
    Datum registracije
    24.12.2012
    Postovi
    3.778
    Sviđanja / Nesviđanja
    Zahvali
    7.125
    Pohvaljen 8.714 puta u 5.181 postova
    Moć reputacije
    0
    Dok se ovaj Zone pojavi ja napravih nekako svoj od onoga.

    Sada mi je ok ovako, samo mi još treba da podesim da ovi indikatori za glasnoću budu osetljiviji:


  3. #3
    Banovan
    Datum registracije
    24.12.2012
    Postovi
    3.778
    Sviđanja / Nesviđanja
    Zahvali
    7.125
    Pohvaljen 8.714 puta u 5.181 postova
    Moć reputacije
    0
    Evo kome se sviđa:




    Skinite i instalirajte gadget:

    Kod:
    http://www.deviantart.com/art/Placebo-Volume-Control-Polish-version-289951324
    Skinite ove moje papazjanije i prekopirajte u C - Users - vaše ime - App data - Local - Microsoft - Windows sidebar - Gadgets - Placebo (Pronađite folder images i fajl gadget.css):

    Kod:
    https://mega.nz/#!vEhFVS6J!sXb0UbBlHBiqKzXkyUf_NbcwxNKrOoi3asrkkYTnnIg


Informacije teme

Korisnici koji pretražuju ovu temu

Trenutno je 1 korisnik(a) koji pretražuje(u) ovu temu. (Članova: 0 - Gostiju: 1)

Ovlašćenja postavljanja

  • Vi ne možete postavljati nove teme
  • Vi ne možete postavljati odgovore
  • Vi ne možete postavljati priloge
  • Vi ne možete menjati vaše poruke
  •  
Vreme je GMT +1. Trenutno je 08:15.
Pokreće vBulletin®
Autorsko pravo © 2019 vBulletin Solutions, Inc. Sva prava zadržana.
Srpski vBulletin prevod: Nicky
Image resizer by SevenSkins

Forum Modifications By Marco Mamdouh

Search Engine Friendly URLs by vBSEO 3.6.1