Sass | Less
-----------------+-----------------
$color: red; | @color: red;
div { | div {
color: $color; | color: @color;
} | }
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Project Title</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<!-- Twitter Bootstrap --> |
<!DOCTYPE html> | |
<html manifest="manifest.appcache"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="pragma" content="no-cache"> | |
<!-- System --> | |
<script> | |
</script> | |
</head> |
layout | title | date | comments | categories |
---|---|---|---|---|
post |
Installing Octopress |
2011-08-18 19:56 |
true |
linux octopress ruby rvm jekyll rubygems |
I (rather obviously) recently found myself attempting to install Octopress. Sure, it has great documentation, but some areas were lacking -- specifically, initial setup. As someone who has not worked with Ruby before other than a rather limited Windows install for a jekyll project, I had virtually no experience installing Ruby, using RVM, or even playing with RubyGems.
JavaScriptMVC's views are really just client side templates. Client side templates take data and return a string. Typically, the strings are HTML intended to be inserted into the DOM.
$.View is a templating interface that takes care of complexities using templates:
TODOS:
JavaScriptMVC's controllers are many things. They are a jQuery plugin factory. They can be used as a traditional view, making pagination widgets and grid controls. Or, they can be used as a traditional controller, initializing and controllers and hooking them up to models. Mostly, controller's are a really great way of organizing your application's code.
Controllers provide a number of handy features such as:
TODOS:
JavaScriptMVC's controllers are many things. They are a jQuery plugin factory. They can be used as a traditional view, making pagination widgets and grid controls. Or, they can be used as a traditional controller, initializing and controllers and hooking them up to models. Mostly, controller's are a really great way of organizing your application's code.
Controllers provide a number of handy features such as:
JavascriptMVC (JMVC)是一個基於jQuery的開放原始碼js框架。 它擁有完整的前端框架解決方案,包含打包工具,測試,代碼依賴管理,文件化,以及附帶許多有用的jQuery外掛。
JavascriptMVC的每一個項目都可以被獨立使用而不需要依賴其他項目。只看Class, Model, View, Controller部分的大小壓縮過只有7k左右,而且這之中的任何一個都還是能被獨立使用。 JavasriptMVC的輕巧及強大的獨立性使得它能應付複雜的大型web專案。
這個章節 只會 提到JavaScriptMVC的$.Class,
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |