JSPOPUP: An interactive Pop-up Window JQuery Library

October 8th, 2011

JSPOPUP is javascript library I made for displaying popup window that floating on a page. JSPOPUP support two mode:

1. Modal pop-up: when pop-up window appear, background page will be inactive, user should focus on the pop-up
2. Child pop-up: one or more pop-up window may appear and will not block original page. Pop-up window can be moved or closed

1. Installing JSPOPUP

You can download source code here.
You also need to download JSPOPUP internal CSS code here

Include this javascript file in your HTML header section:

<script type="text/javascript" src="jquery.min.js">
<script type="text/javascript" src="jspopup.js">

JSPOPUP need JQuery library in order to work. You can download minimalize version here and include in HTML header like shown above.

Include jspopup.css in your HTML header section:

<link rel="stylesheet" href="jspopup.css">

2. Using JSPOPUP as Modal Window

JSPOPUP is generic javascript library, in order to display a pop-up window, you must create html code for that window(separate from main page’s html). This mean that you can freely design your pop-up window. Ok, lets try a basic pop-up window as introduction.

First, create test1.html :

<div class="testdiv">
This is an example of simple modal popup.
<!-- we need a close button -->
<input class="JSPOPUP_close" type="submit" value="close" >
</div>

For this demonstration, you need this additional CSS setting(insert it to your CSS file):


.JSPOPUP_titleBar{
    background-color: #6666cc;
    color :#ffffff;
    border-color:#000000;
    border-style:solid;
    border-width:0px;
    margin-top:0px;
    margin-bottom:0px;
    margin-right:0px;
    margin-left:0px;
    padding-left:6px;
    padding-right:6px;
    padding-top:3px;
    padding-bottom:3px;
}

.testdiv{
    width:300px;
    font-size:10pt;
    background-color: #ffffff;
    color :#000000;
    border-color:#000000;
    border-style:solid;
    border-width:0px;
    margin-top:0px;
    margin-bottom:0px;
    margin-right:0px;
    margin-left:0px;
    padding-left:8px;
    padding-right:8px;
    padding-top:3px;
    padding-bottom:3px;
}
.testdivborder{
    border-width:2px;
    border-color:#000000;
    border-width:4px;
    border-style:solid;
}

Last, in main page HTML code you can call pop-up window using function JSPOPUP_createModalPopUp(). In this example we use a button:

<input type="submit" value="Display test1 pop-up"
  onclick='JSPOPUP_createModalPopUp("test1.html")'>

Demonstration 1:

In test1.html shown above, we need some element as close button for pop-up window. Close button can be any element having class name JSPOPUP_close. We can also close pop-up window by programmatically call function JSPOPUP_closePopUp(), as in example:

<div class="testdiv">
This is an example of simple modal popup.
<!-- close button alternative-->
<input onclick="JSPOPUP_closePopUp()" type="submit" value="close" >
</div>

Moveable Window

We can create draggable pop-up window by add some component in pop-up HTML code with class name JSPOPUP_titleBar. Lets create test2.html with nicer design:

<div class="testdivborder">
<div class="JSPOPUP_titleBar">
Modal Popup
</div><div class="testdiv">
This is an example of draggable modal popup. Since the blue title bar
class name is JSPOPUP_titleBar, you can drag this popup window
by dragging that title bar
<br><br>
<input type="submit" value="close" class="JSPOPUP_close">
</div>
</div>

Then, in main page HTML code we call:

<input type="submit" value="Display test2 pop-up"
  onclick='JSPOPUP_createModalPopUp("test2.html")'>

Demonstration 2:

3. Using JSPOPUP as Child Window

Sometimes you want to create pop-up window that doesn’t blockage the main page and can create more window without waiting user to close the previous one. For example, you want to create a toolbox window that can be shown or closed. For this purposes, we can simply change calling function to JSPOPUP_createPopUp(), as in example:

<input type="submit" value="Display test3 pop-up"
  onclick='JSPOPUP_createPopUp("test3.html")'>

Demonstration 3:

That’s it. You can experiments with your pop-up window design, customize it for your needs :)

Lensa Tamron 17-50mm f/2.8, upgrade tepat untuk lensa kit

May 29th, 2011

Pada posting ini saya akan mencoba mengulas mengenai salah satu lensa favorit saya, yaitu lensa TAMRON SP AF 17-50mm f/2.8 XR LD Aspherical (IF) Di II. Namanya cukup panjang memang. Anda dapat membeli lensa ini dengan beberapa pilihan mounting seperti Canon EOS, Nikon, dan Sony Alpha. Memiliki focal length 17-50mm, lensa ini sangat cocok untuk walkaround lens saat bepergian atau travelling bersama keluarga/teman.

Focal length ini sangat mirip dengan lensa kit bawaan kamera-kamera entry level Canon dan Nikon yaitu 18-55mm. Ada beberapa alasan untuk melakukan upgrade dari lensa kit tersebut ke lensa tamron ini :

1. High speed
2. Depth of field
3. Build quality
4. Sharpness

Keunggulan utama dari lensa ini adalah bukaannya yang besar yaitu 1/2.8. Keunggulan bukaan besar adalah kecepatan pengumpulan cahaya dan depth of field. Dibandingkan lensa yang memiliki bukaan 1/4, lensa tamron ini dapat mengambil gambar sekitar 2x lipat lebih cepat. Well, memang, lensa tamron ini tidak memiliki fitur stabilizer seperti pada kebanyakan lensa-lensa kit. Hal ini membuat keunggulan kecepatan pengambilan gambar menjadi berkurang. Namun perlu diingat bahwa fitur stabilizer tidak akan membantu dalam pengambilan yang bersifat moment freeze karena tetap membutuhkan kecepatan lensa dalam pengambilan cahaya.

Tidak seperti lensa kit yang relatif datar-datar saja, depth of field yang dihasilkan dari bukaan besar lensa ini menghasilkan gambar yang lebih dramatis. Bokeh yang dihasilkan(out of focus area) juga cukup bagus karena memiliki 7-blade aperture. Yang cukup menarik, lensa ini sangat TAJAM mulai dari bukaan paling besar(1/2.8) dan mencapai klimaks pada bukaan sekitar 1/5.6.

Terlepas dari masalah bukaan, focal range ini berada pada range 17-50mm, yang mana range tersebut jatuh pada range walk around lens. Dibanding lensa kit, lensa ini memiliki kemampuan wide angle yang lebih besar(17mm) sehingga membuat lensa ini semakin menarik.

Untuk masalah fisik, lensa ini terbilang cukup baik build quality-nya, terutama jika dibanding lensa kit. Handling fokusnya juga nyaman dan oh iya, lensa ini sudah dilengkapi hood pada paket pembeliannya.

Beberapa kelemahan yang saya temui dalam lensa ini antara lain motor auto focusnya yang cukup berisik, hal ini cukup mengganggu ketika ingin melakukan shoot di dalam ruangan dimana kesunyian harus dijaga. Sebagai contoh ketika memoto bayi yang sedang tidur. Untuk kecepatan fokus, sebenernya lensa ini cukup cepat, namun ketika di dalam ruangan, suara berisiknya akan memberikan kesan lambat. Seperti lensa third party lain, ketika disandingkan dengan body canon 1000D, saya selalu menemui beberapa foto yang over exposure. Hal lain adalah reproduksi warna yang kurang alamiah pada beberapa shoot(terlalu warm atau terlalu cool). Kalo saya pribadi, kelemahan-kelemahan ini masih cukup worth mengingat harga yang tidak terlalu mahal dan benefit dibanding lensa kit :)

lensa ini memiliki saudara kembar yaitu TAMRON SP AF17-50MM/2.8 XR VC DI II LD ASPHERICAL (IF) yang memiliki spesifikasi hampir sama namun memiliki fitur tambahan yaitu Vibration Compensation(VC), istilah Tamron untuk image stabilizer. Walaupun lebih mahal, beberapa review mengindikasikan bahwa optik versi non-VC lebih baik dari versi VC ini.

How to install third party 3G modem on Dell Vostro V13

October 24th, 2009

I like my Dell Vostro V13. It’s super light and very comfort to carry around. The performance is good enough for my office works. You may want to read v13’s review here.

In its website, Dell states that this product can be customized for wireless broadband internet connectivity, it will costs you $125. Quite expensive though. Sure, we can just buy USB 3G modem for around $30-$60, but since I am worshiping V13 for its portability and elegance, I do thing that big, bulky, dangling USB dongle in the back port will ruined it all. Second, since V13 only have two USB ports, you have to use those ports as effective as possible.

Looking for cheaper solution, then I came to this website and found that they sell Sierra Wireless MC8775 HSDPA for only $30.

Here are some links containing information for this product:

Hardware Setup

WARNING!!
These contains several hardware modifications. Make sure you have already read the official laptop’s service manual, or at least knows exactly what you are doing. Remember, the risks are always yours

I strongly recommends you to read this official Dell V13’s service manual before proceeding.

This MC8775 use Mini PCI-E interface. Some call it “WWAN interface”. Many recent laptops including V13 have a dedicated slot for WWAN connectivity that based on this interface. Take a look:

There is one slot empty for Mini PCI-E in and two unused antenna cables in V13. Other one slot Mini PCI-E and antenna cables are occupied by Intel WiFi card. Theoretically I can just plug my MC8775 to Mini PCI-E slot and connect one antenna cable to the card(you have to connect two antenna cable if your 3G/WiFi card support MIMO antenna, MIMO-capable card should have better signal quality and more data rate, unfortunately, MC8775 doesnt support it). Take a look:

Ok, set up is done, now it is time to test the modem. When I press the power button, my V13 didnt want to turn on, the power LED only blink twice. What happen?

Yes, it’s very dissapointing that V13 bios prevent my laptop to turning on because it detect third party modem(MC8775) connected to its mainboard. Very dissapointing that Dell use this monopoly strategy to restrict end users to only buy WWAN connectivity option based on DELL official.

I don’t give up. There are two approach to hack this locked slot issue:

  1. Software approach
  2. Hardware approach

Software approach(untouched)

Software approach involves bios modification and MC8775 firmware update modification. Unfortunately, I found out that my V13 use Securecore Phoenix as its bios. It has security as its key feature. Trying to hack my V13 bios may end up sending my whole laptop to the service center and paid as much as half the price of new V13. Never mess with your laptop bios unless you’re sure what you’re doing.

Another software approach is to hack modem’s firmware update. The focus is to change device Product ID(PID) and Vendor ID(VID) of MC8775, fouling V13 bios as it will sense original Dell official modem instead of third party, MC8775 modem. This is only work if V13 bios detect product ID using USB enumeration mechanism. I doubt that. I guess V13 bios use another way that is, more simple than a complex USB enumeration process(I found this is true when I tried hardware approach). I leave all the software approachs untouched.

Hardware approach(success)

Mini PCI Express interface contains sub-interface:

  • PCIeƗ1
  • USB 2.0
  • SMBus
  • GPS
  • SIM card for GSM and WCDMA applications
  • 1.5 and 3.3 volt power
  • other reserved pins

Mini PCI-E 3G Modem cards basically use only USB 2.0, SIM card, and power sub-interface. Some 3G card has built-in GPS capability so it also utilize GPS sub interface(it’s not the case for MC8775). Refer to this Mini PCI-E pinouts table, I try to isolate all metal connector that doesnt belong to USB 2.0, SIM Card and power signal(USB_D-, USB_D+, GND, +1.5V, +3.3V). This based on assumption that the motherboard/bios use some of reserved pins as a sensing medium to detect the presence of modem card. If there is modem detected, then the motherboard detect(utilize the same pins) wheter it is attached to a certified device or not.

I also made assumption that the motherboard/bios doesn’t use SIM card and USB sub interface for sensing and verification purposes as these two interface may have its own controller that somehow cannot be bypassed easily by the bios, so they use reserved pins instead.

Unfortunately, the pinouts table does not show which pin that carry SIM card signals. So I do trial and error, that if in case I isolate a metal connector that belongs to SIM card interface, the 3G modem software will assert “Insert the Sim Card!”(make sure you have succesfully load the sim card to its tray, based on Dell V13’s service manual). Make sure you don’t blockage any power pins. All of them are required because the current limitation for each pin may smaller than total current needed for the modem to work.

After several trial and error, I got the pins that should be blocked to prevent bios detect third party MC8775 modem and shut down the laptop: 37, 39, 41, 43, 45, 47, 49, 51. After I put metal isolator on these pins, I reinstall the modem, and turn the laptop on. Tada!! My V13 successfully boot to Windows 7. Now I can browsing seamlessly with the 3G modem planted in my slim, light, ultra-portable, Dell V13 :)