Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Nao
166
Features: Posts & Topics / Automatic Quote splitter
« on May 11th, 2011, 08:24 AM »
Feature: Automatic Quote splitter
Developer: Nao
Target: users
Status: 100% (complete.)
Comment:

Another simple feature, but it took me ages to fine-tune, mostly because as far as I know, Wedge is the first ever forum system to do this.

When you're replying a post by someone and you want to break up their quoted text into several parts for convenience, you usually have to do some convoluted copying and pasting. Not so with Wedge.

Just put your cursor wherever you want to split the quote, and... press the Shift + Enter key combination (or Ctrl + Enter, your preference.)
That's it, you're done. The quote gets split automatically. Nested tags are taken into account, so you can even split a quoted quote, or right in the middle of a code tag, anything like that which used to be a nightmare before for power users...

It's so easy now, I may have to add a setting to disable this, just in case you miss being upset with all of the manual quote splitting. :eheh:

Let's take this example here, with nested tags:


Quote from Nao on March 3rd, 2011, 03:56 PM
Seriously!
Code: [Select]
Hello world

[quote author=Nao link=msg=19 date=1299164218]
Seriously!
[code]Hello
Click here and press Shift+Enter world[/code][/quote]


After pressing Shift+Enter, this becomes:


Quote from Nao on March 3rd, 2011, 03:56 PM
Seriously!
Code: [Select]
Hello
Quote from Nao on March 3rd, 2011, 03:56 PM
Code: [Select]
world

[quote author=Nao link=msg=19 date=1299164218]
Seriously!
[code]Hello [/code][/quote]

Cursor is here now.

[quote author=Nao link=msg=19 date=1299164218][code] world[/code][/quote]

167
Features: Upcoming / Private tag
« on May 11th, 2011, 08:07 AM »
Area: BBCode
Feature: Private tag
Developer: Nao
Target: users
Status: 30% (working but not committed; some features need to be added.)
Comment:

Use the 'private' tag inside a post to make sure only some people can read a portion of your message. This is different from the spoiler tag, as the portion will not be hidden, but completely removed from the message for those who can't read it.
168
Features: Theming / Wess: the Wedge preprocessor for CSS
« on May 10th, 2011, 07:01 PM »
Feature: Wess (or WESS, or WeCSS, as you like...)
Developer: Nao
Target: themers, modders
Status: 100% (believed to be complete; given its nature, however, new features are being added regularly as needed.)
Comment:

This is one of the features that make me glad I made them, even though it took me many months of work. For the record, back in January 2011, I read an article about Sass, a CSS pre-parser written in Ruby. I already had plans to write something in that style, but they were nowhere near as advanced as their implementation, so I took inspiration and wrote my own PHP version. As a result, it's about 20 times smaller than Sass, and much faster. It's also a bit less elegant (in that it doesn't optimize resulting rules), and stricter in its structure, but I consider this to be a good thing. Finally, Wess also deals with JavaScript and CSS compression, although the line between Class-CSS[1] and Subs-Cache[2] is becoming increasingly blurrier. (Is that proper English?)

Given that Wess is an extremely complete (and sometimes overwhelming) implementation, it deserves, and will eventually get, its own documentation in the near future.
In the meantime, here's an incomplete list of features:

- selector inheritance ('extends' keyword),
  - multiple inheritance (both from and to),
  - prevent single rules from being inherited by children ('final' keyword),
  - cancel inheritance ('unextends' keyword, useful for inherited skins),
  - delete a property entirely ('@remove' command),
  - reset a selector's earlier styles ('@reset' command, also useful for inherited skins),
  - declare virtual selectors that will disappear once they're mixed or inherited.
- nested selectors,
- normal or simplified syntax (no {}; etc.),
- color manipulation functions,
- math functions,
- mixins (supporting parameters),
- variables,
- @if/@else/@endif (test for a browser or environment, and execute CSS accordinly),
- @is (basically an inline @if),
- & shortcut (current selector),
- cross-browser gradients,
- prefix-free CSS3 styles (just the common ones),
- grouping of properties with identical values (e.g. height, line-height: 20px),
- RGBA emulation in IE,
- and inline graphics where supported (can be disabled on a per-file basis.)

The example below is taken straight from our current index.css, and it uses many of the aforementioned features... Try to figure out what does what!

.catbase virtual
   overflow: hidden
   border-radius: 5px
   padding: 5px 10px 5px
   margin-bottom: 4px
   border: 1px solid rgba(0,0,0, .15)
   font: 700 1.4em/20px $big_font
   img
      vertical-align: -3px

.cat extends .catbase
   background-color: #b3afa9
   color: white
   a
      color: white
      text-decoration: underline
      font-size: .92em
      text-shadow: none
      :hover
         color: #fc9
     .cat final
   background-color: #c3b9c3
   border-color: #fd9604
   border-width: 2px 0 0 0
   text-shadow: black 0 1px 2px
   .table_list &
      margin: -5px

.title extends .cat
   padding: 4px 8px
   border, margin: 0
   #sidebar &
      margin-top: 6px
   a
      color: #faf8f8
 1. The main Wess core...
 2. The list of functions that create the actual CSS and JS files and pass them through Wess or other functions.
169
Features: Theming / CSS caching
« on May 10th, 2011, 06:43 PM »
Feature: CSS caching
Developer: Nao
Target: everyone
Status: 100% (believed to be complete.)
Comment:

This is pretty much the same as for JavaScript caching, except that there's only one code path for CSS, since there aren't 50 ways to minify stylesheets.

Now, I'd just like to point out that thanks to the preparser, Wedge's cached CSS files will also embed all of the icon data, saving you yet another number of additional hits that servers and browsers usually don't like too much. IE6 and IE7 don't support data embedding, so they'll simply keep using external links. Who uses these stupid browsers anyway?
170
Features: Theming / JavaScript caching
« on May 10th, 2011, 06:43 PM »
Feature: JavaScript caching
Developer: Nao
Target: everyone
Status: 100% (believed to be complete.)
Comment:

Right after minifying your CSS and JS files, Wedge will cache them and gzip them. The good point is that it's smart enough to cache multiple files together, relieving the server a bit.

I'll use my script.js example again. At the time of writing, the regular script.js/theme.js duo is about 50KB in SMF2 (split over two files), less than 30KB in Wedge (with many extra functions in them), and the actual stuff you download is a single 6KB file, after minification and gzipping. Meanwhile in the wasteland, SMF2 still sends you 50KB of data. Because everyone knows all end-users absolutely need to have comments in the JavaScript code they execute.
171
Features: Theming / CSS and JavaScript minification
« on May 10th, 2011, 06:43 PM »
Feature: CSS and JavaScript minification
Developer: Nao
Target: everyone
Status: 100% (believed to be complete.)
Comment:

Wedge likes bandwidth optimization. Wedge is sad when its pages don't show up immediately. Wedge is a good boy.
Whenever you upload a modified CSS/JS file to your styles or scripts folder, it will catch it, minify it on the fly and cache it.
Minification is a process that removes all comments, whitespace and things that aren't needed for the code to work. CSS is easy to minify, but JS is sometimes a bit capricious, so I added support for JSMin minification (the safe one), Packer 3.0 (the efficient one), and no minification at all (useful for debugging your scripts.)

We recommend using Packer, it's nearly as efficient as UglifyJS. A note to modders: just make sure your JavaScript passes JSLint validation, or at least you don't forget to add semi-colons at the end of var fn = function () { ... }; declarations, otherwise Packer will choke on it (it's fixable, but we'd rather not make the script slower because of lazy programmers.)
172
Features: Theming / Template macros
« on May 9th, 2011, 06:36 PM »
Feature: Macros
Developer: Nao
Target: themers, users
Status: 95% (believed to be complete. May need to add features later)
Comment:

Wedge allows skins to define macros in the index template, i.e. blocks of HTML code that you can customize on the fly. You can then call them through <we:yourmacro yourparams="...">Your body</we:youmacro> in all templates. Skins can then override these macros easily.
You can set macros conditionally, i.e. have a macro show up only for members or guests, have another macro show in a certain way to IE6 users and another way to users of other browsers, etc. It's pretty powerful all in all.

Macros available at press time: category, title and title2 headers, block (regular box with optional header and footer), and various wrappers needed for proper sidebar handling.
173
Features: Theming / Skins
« on May 9th, 2011, 06:35 PM »
Feature: Skins (previously 'stylings')
Developer: Nao
Target: everyone (mainly themers)
Status: 95% (believed to be complete; but I added so many features since then... It's probably going to evolve even more.)
Comment:

Skins are Wedge's answer to SMF's CSS variants.
The theme folder's "css" folder is now a "skins" folder with a nested structure. It is one of the most complex new features in Wedge, so it's difficult to describe it thoroughly in a single paragraph. I'll write some proper documentation when the time comes.

In the meantime, just know this: a skin can totally redefine most aspects of a theme without any code modding. Replace or add to the current stylesheets, add jQuery code or remote JavaScript files, rewrite template macros, and optionally set these only for specific browsers. Most importantly, skins allow you to redefine the structure of the template skeleton, which is Wedge's way of handling what SMF called 'template layers' and 'sub-templates' in a way that actually makes sense for designers.

You can also customize the current CSS yourself (add a custom.css file to the skin), or create new skins that inherit (or completely replace) settings from their 'parent' skins. Choose a default skin for guests, play with inheritance by physically moving folders... Themers can expect a lot of fun playing with Wedge.
174
Features: Posts & Topics / Previous/next topics
« on May 9th, 2011, 06:34 PM »
Feature: Previous/next topics
Developer: Nao (main), Arantor
Target: users
Status: 100% (believed to be complete.)
Comment:

This seems very simple, but the implementation was more complicated than expected, especially in terms of performance. Basically, we thought the "previous/next" topic links in topic pages were misleading. People could be led into believing that these were shortcuts to the next page in a topic.
We 'fixed' it by directly showing the names of the topics involved. As simple as that... But again -- it's nice enough to be considered a new feature. Also, we now offer proper 'previous' and 'next' links in the page links area. (These lead to the next and previous page in the topic, obviously.)
175
Features: Posts & Topics / Merge Double Posts
« on May 9th, 2011, 06:34 PM »
Feature: Merge Double Posts
Developer: Nao
Target: users
Status: 100% (complete.)
Comment:

Some admins don't like when users post multiple messages in a row on a topic. This feature allows them to automatically merge these posts until after a certain delay has passed. Users can also choose to merge posts manually with a Merge button.
176
Features: Theming / Permanent sidebar
« on May 7th, 2011, 01:04 PM »
Feature: Permanent sidebar
Developer: Nao
Target: users, modders, themers
Status: 100% (complete; might need to add features in the future.)
Comment:

This is one of our most controversial moves. Well, maybe not, but at least one that could be questioned.
Basically, Wedge now always shows a sidebar on the page, and moves it to the bottom if the page is too narrow. It systematically shows your user box (hello user, date, avatar, unread posts, unread replies) at the top, and RSS links at the bottom, and then adds contextual data based on the current page. Calendar pages show day links in the sidebar. Media item pages may show item details in the sidebar (although they'll usually use their own additional sidebar.) Dropdown menus may be moved to the sidebar... Things like that.

In addition, modders can easily add any kind of block to the sidebar by calling loadBlock('my_block_function', ':side'). The same can be done with the top template, which is a series of blocks (sub-templates) that are called before the main template is actually shown, allowing you to add important information at the top without reorganizing everything.
177
Features: Security / JavaScript protection
« on May 7th, 2011, 01:03 PM »
Feature: JavaScript protection
Developer: Nao
Target: modders, geeks
Status: 100% (complete.)
Comment:

Sometimes, a developer will be very protective of their code. We understand that. JavaScript code, unfortunately, is by nature in plain view. Wedge offers an option to obfuscate JavaScript filenames, making it harder (if not impossible) to find the original unminified file with comments. And even if someone did... Well, there's now a nice little .htaccess file in the script folder that prevents directly access to the original files. We didn't try to encrypt JS data in the cached file because, let's be clear, it can still be decrypted easily through a JS debugger. We're not making it impossible to get the JS source code -- only more annoying.
178
Features: Security / Bad Behavior
« on May 7th, 2011, 01:03 PM »
Feature: Bad Behavior
Developer: Arantor
Target: users, admins
Status: 99% (complete, needs testing in specific situations. Needs a UI for checking out the intrusion log.)
Comment:

This adds Bad Behavior protection to Wedge. It is integrated into the code and always executed. It's also very fast, so don't worry about performance. Bad Behavior's goal is to keep as much spam out of your forum by detecting any suspect behavior from a user that might link them to actually being a poorly programmed spam bot. If by any chance, an actual user has their action refused by Wedge, they will receive a proper error message and they can forward it to the admin (or the Wedge authors) along with a description of what they attempted to do.
179
Features: Posts & Topics / Auto-saving Drafts (posts and PMs)
« on May 7th, 2011, 01:02 PM »
Feature: Auto-saving Drafts (posts and PMs)
Developer: Arantor
Target: users
Status: 95% (complete; one bug left to fix.)
Comment:

Have you ever yelled at your PC/browser for crashing right in the middle of writing a post about Life, the Universe and everything? The answer is 42, which is the average number of times in a year you'll get to thank Pete for writing this feature.
If you're writing a post but feel like finishing it later, you don't have to keep that tab open... Just use the Save Draft feature to access the post later in your profile area, draft section. You can then resume the edit process and finally complete your message. If the topic is locked before your draft is completed, you're given the option to post it as a new topic. Drafts now have a maximum lifetime, avoiding abandoned drafts that are no longer going to be posted. And user can delete all of their drafts in a single click.
Even better, your posts are automatically saved every 30 seconds (can be configured), so that you don't lose your post if your computer crashes. And finally, Pete added to Wedge the same feature for personal messages. Now you know what to do.
180
Features: Posts & Topics / User menu
« on May 7th, 2011, 01:01 PM »
Feature: User menu
Developer: Nao (main), Arantor (original code)
Target: users
Status: 99% (believed to be complete; need to review what should be in the menu and what shouldn't.)
Comment:

Stop with the waste of screen estate! We gathered user links under a menu that pops up with a nice animation when you hover a user name in topic pages. Just move the mouse out of that area to close the popup. Wait until you see it in action -- we're sure you'll love it.