Freitag, 25. Juni 2010

Colors of the Solar System

I've been, well, less uncreative than normal and came up with this nice Wallpaper (at least I think it's nice ;-)). The illustration represents the 8 planets of our solar system as well as the sun (in the centre - obviously).


16:9 Resolutions





16:10 Resolutions





Have Fun!

Oh, and in case you're missing Pluto: As you may know, Pluto is no longer considered a Planet. As of 2006, Pluto is a dwarf planet called 134340 Pluto, occupying an orbit (partially) in the Kuiper-belt. Read up on the whole topic here and here.

Donnerstag, 24. Juni 2010

List bullets for your HTML

I got bored with the usual List Bullets on a recent Project of mine - so I created a few new ones. Here they are


Black bullets in action: Watch here.
White bullets in action: Watch here.
Transparent bullets in action: Watch here.

Download the full pack here.

Mittwoch, 23. Juni 2010

Ugly java UI of the month: June


Remember Azureus? This nice BitTorrent client has been there long before my current favourite uTorrent (you should get uTorrent, it's small, easy to use and quite well coded). Like all good things Azureus came to an end when they renamed it to Vuze, bloated it with stuff no one (at least I hope no one) uses and made Shitware out of it. Now it has an integrated high def (wow) player and shitty rss stuff. For $24.99 it even comes with DVD bruning and built-in antivirus protection. WHAT A PIECE OF SHIT.

But that's not the worst of it, because features can be turned off (at least I hope one can turn of Built-In antivirus protection, since wow.. I already have anti-virus software installed). No, the worst thing is the fugly User Interface. The UI of Vuze literally looks like Apple puked all over it. Or maybe Azureus got drunk and met iTunes in a dark backyard.

Just look at it, doesn't this remind you of ugly iTunes? Well I wont get into iTunes now, because it's the worst Shitware out there. But why do UI designers like this lame iTunes style that much? I don't know... maybe because they don't get screwed by Apple like developers do. iTunes and Vuze kinda look like Pampers meets a drunk bum-version of the guy who designs CD covers for MUSE.

Bullshit.

Sonntag, 20. Juni 2010

MicroModal

INFO: Take a look at my microUI website template. It contains the newest version of MicroModal and lots of other nice goodies!

MicroModal can be used to display a modal window on click. Useful scenarios include: "Are you sure you want to ...?", "Please enter ...!", and so on.

This isn't one of those huge modal scripts with CSS files and fancy graphics - if you want it fancy, use (or wait for) CSS3. This solution is fat-free.

Screeshot


Demonstration
Check out the demonstration here.

Example
The JavaScript
$('.micromodal').microModal({
    autoPositioning: true, // set true if you wish to center the modal window (default: true)
    overlay: {
        show: true,        // set true if you wish to how an overlay (default: true)
        color: '#fff',     // set the colour of the overlay (default: '#fff')
        opacity: 0.8       // set the opacity of the overlay (default: 0.8)
    }
});

The Html
<button class="micromodal target-changecolor">Let's change the background colour!</button>
  
<div id="changecolor" class="dialog">
 Do you really want to do this?
 <br /><br />
 <button onclick="$.fn.microModal.dialogs['#changecolor'].close();">No way!</button>
 <button onclick="$('body').css('background-color', '#fedcba');$.fn.microModal.dialogs['#changecolor'].close();">Sure</button>
</div>

The Css - if you don't know what to do yourself - find another JQuery Plugin ;-)

Download
Source Code
Compressed Code (for use in productive environment)

Mittwoch, 16. Juni 2010

MicroTab 0.1 Released

Hey, there's been another Micro release. This time it's MicroTabs. If you want a small (1 Kb) and easy to use tab plugin with no (in my view) lame animations. Check it out.


How To
The HTML
<div class="micro"> 
    <a href="#">Title</a> 
    <div>Content</div> 
</div> 

The JavaScript
$('.microtabs').microTabs({
    selected: 1 // yeah this is the only option - which tab do you want to show on startup?
});

And some CSS
.microtabs { margin:20px 20px; max-width:800px;}

.microtabs-button { 
 padding: 10px; 
 background-color:#333; 
 color:#fff; 
 text-decoration:none; 
 font-family:Segoe UI, Helvetica, Arial; 
}
.microtabs-button:hover { color:#abcdef; }
.microtabs-selected { 
 background-color: #fff; 
 color: #333; 
 border-right:1px solid black; 
 border-top:1px solid black; 
 border-left:1px solid black; 
}

.microtabs-element { 
 background-color:#fff; 
 color:#555; 
 padding:10px; 
}

.microtabs-header { margin-bottom: -1px; }
.microtabs-container { border: 1px solid black; 

Demonstration
Get a look at the demo here.

Download
Source code
Compressed version (for production)

MicroTab 0.1 Released

I have moved! You'll find MicroTab on my new Blog: http://salatsosse.ch/jquery/

Dienstag, 15. Juni 2010

Drag and Drop files from WPF ListViews to the Desktop / Windows Explorer

Hey guys, this morning (yeah, beginning 7.00) I tried to implement what seemed to be quite an easy task: Dragging files out of my app onto the desktop or into an open explorer Window.

It’s not quite easy. So let’s start this small tutorial. First (of course) you create an ListView – let’s call it “FileView”.

<ListView x:Name="FileView" 
PreviewMouseLeftButtonDown="FileView_PreviewMouseLeftButtonDown"
MouseMove="FileView_MouseMove">
<ListView.View>
<GridView>
<!-- Put in here whatever you need -->
<GridViewColumn Header="Name" CellTemplate="{StaticResource file}" />
</GridView>
</ListView.View>
</ListView>


Now to the code behind the xaml. You might have noticed that I added two events to the ListView. The PreviewMouseLeftButtonDown (the dragging starts) and the MouseMove (the dragging is happening).



private Point start;

private void FileView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.start = e.GetPosition(null);
}

private void FileView_MouseMove(object sender, MouseEventArgs e)
{
Point mpos = e.GetPosition(null);
Vector diff = this.start - mpos;

if (e.LeftButton == MouseButtonState.Pressed &&
Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance &&
Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
{
if (this.FileView.SelectedItems.Count == 0)
{
return;
}

// right about here you get the file urls of the selected items.
// should be quite easy, if not, ask.
//string[] files = ...;
string dataFormat = DataFormats.FileDrop;
DataObject dataObject = new DataObject(dataFormat, files);
DragDrop.DoDragDrop(this.FileView, dataObject, DragDropEffects.Copy);
}
}


Now that’s that, thanks for reading.

Donnerstag, 10. Juni 2010

A StringBuilder for JavaScript

I am currently working on making some cool .net framework classes / functionality available with JavaScipt. When I'm done, there will be a nice js# framework ready for download (my goal is to keep it under 10kb compressed).

Well the first part I did is something I find myself frequently missing when coding with JavaScript: A StringBuilder. When working on a web project, there are loads of occasions which scream for such a nice class. So here we go, the source code:

// =============================================================================
// System.Text.StringBuilder
// =============================================================================
// Implements a StringBuilder.
// Differs from C#! Capacity and Length properties have been removed.
// Prepend has been added.
var StringBuilder = function(string) {
 var _str = (string == null) ? '' : string;
 // Appends a string to the stringbuilders internal string.
 this.append = function(string) {
  _str += string;
 };
 // Appends a formatted string to the stringbuilders internal string.
 this.appendFormat = function(string, array) {
  for(var i = 0; i < array.length; i++) {
   string = string.replace('{' + i + '}', array[i]);
  }
  _str += string;
 };
 // Inserts a string at a specified position inside a stringbuilders internal string.
 this.insert = function(string, position) {
  _str = _str.slice(0, position) + string + _str.slice(position, _str.length);
 };
 // Removes a substring of the stringbuilders internal string.
 this.remove = function(start, end) {
  _str = _str.slice(0, start) + _str.slice(end, _str.length);
 };
 // Replaces any substring inside the stringbuilders internal string.
 // Replaces any substring inside the stringbuilders internal string with ''.
 this.replace = function(oldValue, newValue) {
  newValue = (newValue == null) ? '' : newValue;
  while(_str.indexOf(oldValue) > -1) {
   _str = _str.replace(oldValue, newValue);
  }
 };
 // Returns the strinbuilders internal string.
 this.toString = function() {
  return _str;
 };
};

Well thats that, here's the HTML documentation. Question? Ideas? Comment!

System.Text.StringBuilder

Implements a StringBuilder.
Differs from C#! Capacity and Length properties have been removed.

Constructors

new StringBuilder();

new Stringbuilder(string);

.append(string)

Appends a string to the stringbuilders internal string.
var str = 'abcdef';

var str2 = 'ghijklmnop';

var str3 = 'qrstuvwxyz';



var sb = new StringBuilder();

sb.append(str);

sb.append(str2);

sb.append(str3);



sb.toString();

.appendFormat(string)

Appends a formatted string to the stringbuilders internal string.
var str = 'hello';

var str2 = 'world';



var sb = new StringBuilder();

sb.appendFormat('Oh, {0} there {1}!', [ str, str2 ]);

sb.toString();

.insert(string, position)

Inserts a string at a specified position inside a stringbuilders internal string.
var str = 'abcdef';

var str2 = 'ghijklmnop';

var str3 = 'qrstuvwxyz';



var sb = new StringBuilder();

sb.append(str);

sb.append(str3);

sb.insert(str2, 6);



sb.toString();

.remove(start, end)

Removes a substring of the stringbuilders internal string.
var sb = new StringBuilder('abcdefghijklmnopqrstuvwxyz');

sb.remove(6, 12);

sb.toString();

.replace(oldValue, newValue)

Replaces any substring inside the stringbuilders internal string.
var sb = new StringBuilder('abcdefghijklmnopqrstuvwxyz');

sb.replace('abcdef', '123456');

sb.toString();

.replace(oldValue)

Replaces any substring inside the stringbuilders internal string with ''.
var sb = new StringBuilder('abcdefghijklmnopqrstuvwxyzabcdef');

sb.replace('abcdef');

sb.toString();

.toString()

Returns the strinbuilders internal string.
var sb = new StringBuilder('abcdefghijklmnopqrstuvwxyzabcdef');

sb.toString();

MicroFilter - Filter by elements

I have moved! You'll find MicroFilter on my new Blog: http://salatsosse.ch/jquery/

Filter for Telerik Mvc Grid Version 0.3

Hey, I just did a small update on my gridfilter for the Telerik MVC Grid.

There's just one change: You're now able to put different values into a textbox, just put a ";" between them. So a textbox using the delimiters is handled the same as multiple textboxes with separate values. The column and operator settings will be applied to all elements.

Get the new version here.

Mittwoch, 9. Juni 2010

MicroView

WOOAA!


Microview has been published, read all about it here.

Here we go with my newest JQuery Plugin called MicroView. The main purpose of MicroView is to provide an easy stylable component / widget to display data recieved by JSON or XML. To achieve this, MicroView isn't table based but uses div-nested spans to display the data. This different approach enables you to present your data in many different ways, as the first picture shows. Switching between views is easy as well - and can be triggered client side. By switching a view you can also change the columns you wish to display (and f course their width). And oh yes, as you see in te picture, you can edit your data in every view, as long as your template allows it.

Socialize!