Archive for the 'Atlas' Category

07NovBoo, Ironpython, Scriptaculous, MS Ajax and me

Over the weekend I got the idea of learning ironpython by moving the codebase that I have for nblogr to ironpython script and compiling it.

Everything went fine until I had to decorate a method to make it cache/participate in a transaction/set a layout on a controller because ironpython in all its beauty doesn’t support attributes on methods or classes.

I’m also missing a reference for ironpython. Something that shows the available functions and the syntax for inheritance etc.  which slowed me down of course.

Why do I want a dynamic language ?

The 2 main reasons are : Duck typing and readable anonymous functions.  In c# there is the concept of anonymous delegates but that code really looks like it has been hit by a train, ugly.

I’ve been writing in boo for a while now just as a templating language and yes I like boo a lot.  It combines the nice features of python with the c# language in a wrist friendly way. (I never got the point of wrist friendly thing until I got carpal tunnel syndrome, now it suddenly is a major issue)

I sure wish there would be a language service for visual studio to do boo development but I’ve been using sharp develop 2.1 to check it out.

SharpDevelop 2.1 is a nice piece of work definitely for an open source IDE’, it beats eclipse in my book

In boo everything is an object also your functions and expressions (read it has anonymous functions).  Boo is strong typed but mimics duck typing in some form.

To conclude this little intermezzo : my next project will be written in boo :)

On the ajax library front I would have to report that I haven ‘t looked at atlas/ms ajax since the beginning of september . I had decided to use it again when they finally release the framework.  So I’ve been checking out these other libraries that are out there.  I checked out jquery which is a cool library but it is also slower in execution than the other ones.

The next one on the list was scriptaculous and that is the one I’ve been using in my projects now.  Scriptaculous does exactly what is expected and uses the javascript prototype model which happens to be one i like :)

The move from the guys at MS to make their ajax extensions based on prototype was surprising but very positive in my book :) So when they release it i’ll look at creating an javascript provider for nblogr so that you would be able to switch between your favourite library (we have plans to support the major libraries out of the  box.) 

del.icio.us tags: , , ,

02SepPreview release of NBlogr

Today I put a preview release of NBlogr online.

I still have to change the online site but will do so very shortly.

This release has very basic functionality and is not yet feature complete so a lot may change later on.

If anybody feels like joining the project do not hesitate :) All help I get is extremely welcome.

http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=Nblogr

I’m heading into a very busy week/couple of weeks so I’m not sure if I will be able to spend as much time as I’ve been spending lately on the project.  But I think every week I will be able to show some progress at least.

If you feel like it go ahead and give it a try but don’t upgrade your blog just yet :) .

I’d be keen to know what your thoughts are on the subject.

01SepFileUploading for NBlogr

To upload files in nblogr. I wanted the user to have the possibility to upload as many files as they wanted but only show one file element.

The upload procedure has to work without reloading the page entirely but there is no way of getting the size or the bytes of a file through the html input file control from clientscript without popping up a security warning.
And what do I personally think about security warnings : they are a necessary evil but limit you a lot in the development of contemporary sites with rich client interaction.
If I am to present a site to my parents and they have to figure stuff out themselves I’m pretty sure that once the read the words : Security warning, Potential risk etc… they will click no ==> site doesn’t work ==> site == crap

I wanted to include an upload with progress bar but decided to let that idea go and just give an implementation of a multiple file upload with a single inputelement. Maybe I will put this in during the next iteration. That way I can probably release a ctp this weekend and start thinking about a plugin architecture (thanks for the idea JD)

Because of the file issues i have to run it in an iframe :-s and have the page and the frame talk to eachother.

24AugAptana for writing atlas script

I write quite a lot of javascript code these days and have been looking for a couple of months for ways to make my life easier.

Easier would mean in my opinion to get some kind of intellisense or autocomplete while writing javascript.

As it turns out in visual studio orcas these features will be available so I’ll be a very happy vs orcas user i guess :) .  But in the meantime there is a free eclipse based IDE around aptana that let’s you take advantage of autocomplete etc.

I added the atlas debug files to the default code profile and I was in business.

11AugUser group atlas presentations

This week I went to do a couple of presenations on atlas in the regional user groups here in New Zealand.

At first I was really nervous, so I apologise to the people in hamilton for not getting the best presenation I could give you, I even forgot some stuff that would make all the pieces fit together.

But after the first talk I started to get the hang of it, and now I regret that I can’t do more talks but who knows what the future brings.

It was really interesting to see that there are a lot of really skilled people with a passion for programming in New Zealand.

 

So in all I would like to thank everybody for taking the time to come and listen to my ramblings on Atlas.
And perhaps we’ll meet on Teched next week.

 

23JulSome choices made regarding NBlogr

For the development of NBlogr I had to say goodbye to some of my favorite controls.

The idea of NBlogr is that it is Open Source so that means I can’t use anything that is not open source / free in my project.  I use component arts excellent menu whenever I see fit except for now.

ComponentArt have 2-3 controls in their range that I really like. The other ones aren’t really usefull in my case.

I’ve been using the freetextbox control for 3,5 years now. But the latest versions aren’t really good implementations. If I load up my control in a firefox browser and I reload the site by entering in the address bar.. I get 3-5 errors @ pageLoad.  And that just sucks because the rest of the javascript doesn’t get executed and an atlas page won’t execute.

So for me it’s down with the freetextbox control and up with the tinymce control from moxiecode.
That one is the only true cross browser (IE, FF, Safari, Opera) richt text editor I can find

Another benefit : It’s smaller than the freetextbox and loads way faster.

Captcha isn’t a good solution for blocking comment spam. I’ve decided to use akismet as a refferer and comment blacklist service for NBlogr.

 

21JulMake the freetextbox work inside an atlas updatpanel

A while ago I blogged about making the freetextbox work inside an updatepanel. I didn’t put the code at that time because it wasn’t what it should be.

For the NBlogr engine I do need a working version of that control. And it should work on firefox and internet explorer. Now I have it somewhat working.  I thought it would be best to share this, as I’m sure that there are others that are facing the same problem.

You basically wrap it in an iframe so that it loads it’s script in a page that does not have an update panel on it.
through javascript you get the value of the entered in the freetextbox and set it in an hiddenfield. and voila you’re done.

FreeTextBoxWrapper.ascx :

<


iframe


runat
=”server”


id
=”ifrmTxt”


width
=”600″


height
=”400″


frameborder
=”0″


>
iframe
>

<


asp
:
HiddenField


ID
=”hfFtbValue”


runat
=”server”


/>

And the codebehind for the ascx :

12 [ValidationProperty("Text")]

13 publicpartialclassApp_Components_FreeTextBoxWrapper : System.Web.UI.UserControl

14 {

15 publicstringText

16 {

17 get

18 {

19 returnhfFtbValue.Value;

20 }

21 set

22 {

23 hfFtbValue.Value = value;

24 }

25 }

26 publicstringWidth

27 {

28 get

29 {

30 returnifrmTxt.Attributes["width"];

31 }

32 set

33 {

34 ifrmTxt.Attributes["width"] = value;

35 }

36 }

37 publicstringHeight

38 {

39 get

40 {

41 returnifrmTxt.Attributes["height"];

42 }

43 set

44 {

45 ifrmTxt.Attributes["height"] = value;

46 }

47 }

48 protectedvoidPage_Load(objectsender, EventArgse)

49 {

50 //load the freetextbox page that has no theme and no masterpage set. The background color is the one I chose to blend in with my design

51 ifrmTxt.Attributes["Src"] = ResolveUrl(string.Format(“~/App_Components/FreeTextBox.aspx?hf={0}&w={1}&h={2}”, hfFtbValue.ClientID,Width,Height));

52 ifrmTxt.Attributes["Name"] = ifrmTxt.ClientID;

53

54 if (!IsPostBack)

55 {

56 Session[hfFtbValue.ClientID] = hfFtbValue.Value;

57 }

58 }

59

60 protectedoverridevoidOnDataBinding(EventArgse)

61 {

62 base.OnDataBinding(e);

63 Session[hfFtbValue.ClientID] = hfFtbValue.Value;

64 }

65 }


And the page that contains the freetextbox control :

<%


@


Page


Language
=”C#”


AutoEventWireup
=”true”


Theme
=”"


CodeFile
=”FreeTextBox.aspx.cs”


Inherits
=”App_Components_FreeTextBox”


ValidateRequest
=”false”
%>


DOCTYPE


html


PUBLIC


“-//W3C//DTD XHTML 1.0 Transitional//EN”


“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<

html


xmlns
=”http://www.w3.org/1999/xhtml”


>
<

head


runat
=”server”>

<
title
>
A wrapper for the freetextbox in an atlas:updatepanel

title
>

<
style


type
=”text/css”>

body
{

background
:
#ffdaa0
;//Set your color here

margin
:
0
;
}


style
>

head
>
<

body
>

<
form


id
=”form1″


runat
=”server”>

<
div
>

<
FTB
:
FreeTextBox


ID
=”ftb”


runat
=”server”


SupportFolder
=”~/”


ClientSideTextChanged
=”onFtbClientTextChanged”>

FTB
:
FreeTextBox
>


div
>


<
script


type
=”text/javascript”>

//The lengthy constructor is there so that firefox also knows where to get the text.

function


onFtbClientTextChanged
(){

window
.
parent
.
document
.
getElementById
(
‘<%= MainPageField %>’
).
value
=
document
.
getElementById
(
‘<%= ftb.ClientID %>_designEditor’
).
contentWindow
.
document
.
body
.
innerHTML
;
};


if
(
navigator
.
userAgent
.
indexOf
(
“Firefox”
)!=-1)

document
.
getElementById
(
“<%= ftb.ClientID %>_htmlEditorArea”
).
addEventListener
(
‘change’
,
onFtbClientTextChanged
,
true
);
//for firefox


script
>



form
>

body
>

html
>

With it’s codebehind:

12 publicpartialclassApp_Components_FreeTextBox : System.Web.UI.Page

13 {

14 protectedstringMainPageField;

15

16 protectedvoidPage_Load(objectsender, EventArgse)

17 {

18 MainPageField = Request.QueryString["hf"];

19

20 if (!IsPostBack)

21 {

22 //When the page first loads we need to set the freetextbox with the value from the hiddenfield for databinding etc.

23 stringsetTextScript = string.Empty;

24 if(Request.Browser.Browser != “IE”)//for firefox we need to reach the freetextbox design editor to place our html

25 setTextScript = string.Format(“document.getElementById(‘{0}_designEditor’).contentWindow.document.body.innerHTML = window.parent.document.getElementById(‘{1}’).value;\r\n”, ftb.ClientID, MainPageField);

26 else

27 setTextScript = string.Format(“document.getElementById(‘{0}’).innerHTML = window.parent.document.getElementById(‘{1}’).value;\r\n”, ftb.ClientID, MainPageField);

28

29 Page.ClientScript.RegisterStartupScript(this.GetType(), “setText”, setTextScript, true);

30 ftb.Text = Session[MainPageField].ToString();

31 }

32 //Set the width to 99% so that the freetextbox displays completely

33 ftb.Width = Unit.Percentage(99);

34

35 //Get the height and widht and set the height relative to the width of the iframe (the toolbars move)

36 intheight = int.Parse(Request.QueryString["h"]);

37 intwidth = int.Parse(Request.QueryString["w"]);

38 if (width < 550)

39 ftb.Height = Unit.Pixel(height – 130);

40 elseif (width < 600)

41 ftb.Height = Unit.Pixel(height – 120);

42 else

43 ftb.Height = Unit.Pixel(height – 90);

44

45 }

46

47 }

17JulI opened a workspace for NBlogr on gotdotnet

Today I opened a workspace on gotdotnet for an open source blog engine I started writing.

Everybody is welcome to join in. The space I have on gotdotnet is not so big which means that you’ll have to email me for now to get the complete and current source database.

A little bit later this week I will have a demo site/blog running on http://www.nblogr.com

The characteristics of the blog are :

1. It’s Atlas :)

2. It’s free for everybody to use

3. It’s open source so please if you change something then let me know.

4. Will be focussing on integrating the whole web 2.0 (the real web 2.0) experience i.e. direct integration of flickr etc.

5. The conversion from your current blog software should run without glitches.

I am definitely in need of somebody that knows how to create good templates/xhtml/css designs because that is not my strongest side.

The workspace is located @ http://workspaces.gotdotnet.com/nblogr

 

03JulAjaxPatterns.org

For those of you that are concerned with design patterns for ajax check out this site :

http://ajaxpatterns.org/ 

I have to say that that site is a real gem.  I for one am concerned with usability and am not discriminating so I think the leap to accessibility is only very small.  We are planning an application that is ajaxed and should still be completely usable by blind users which will be intresting to build.

In preparation for this i stumbled upon http://www.maxkiesler.com/index.php/weblog/comments/how_to_make_your_ajax_applications_accessible/

That page has got about 40 links to sites that discuss accesibility in an ajaxed world.

The last issue I’m facing is the fact that because asp.NET renders webresource urls that are incredibly long. The w3 xhtml validator won’t validate my pages and only because of this url.  I want to render valid xhtml 1.1 pages. So that’s something I will be looking at in the next few weeks when I’ve got some spare time.

30JunJavascript obfuscation

I’ve been getting much better along with atlas lately. Almost up to the point that it takes me almost the same time to create page in asp.net than it does me to create a page in atlas. Notice the word almost :) And that’s optimism talking

Anyway it does take a wee while longer to create an atlas page than it would to create an asp.net page. But the result is about 10x as usable and than a normal page.

That being said. All that atlas goodnes comes at a cost : A lot of javascript being pushed down to the browser. When I was in wellington on wednesday there was somebody talking about atlas in the user group.  Seen as I will go talk to the regional groups I was quite keen what Tatham had to say on the subject.

It was interesting but at a certain point he talked about the “obfuscated” javascript files. Those are just packed. That made me think that I also want to have packed javascript that is slightly less readable. I remember I have some open source library that I downloaded a year or so ago.

Well the guy has a nice library that you can download here :

http://dean.edwards.name/packer/

It’s nice but his HttpHandler doesn’t work for me. But there’s a simple work-around. Make your own handler that reads the javascript file and uses his Pack function.

If somebody is interested in the code just drop me an email and i’ll send it to you.


Recent Flickrs

    Blogroll

    Recent Listening

    Scrobbler
    • Loading...