From b0f03758c78f5e2501feb4899ef7eb30e17f9821 Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Tue, 31 Jan 2012 21:25:47 -0500 Subject: [PATCH] Remove whitespace [WhitespaceBot] --- deps/menelaus/README.markdown | 6 +- deps/menelaus/deps/erlwsh/README | 4 +- .../deps/erlwsh/scripts/install_mochiweb.sh | 2 +- deps/menelaus/deps/erlwsh/src/erlwsh.erl | 2 +- deps/menelaus/deps/erlwsh/src/erlwsh_deps.erl | 6 +- deps/menelaus/deps/erlwsh/src/erlwsh_sup.erl | 2 +- .../deps/mochiweb/priv/skel/src/skel.erl | 2 +- .../deps/mochiweb/priv/skel/src/skel_deps.erl | 6 +- .../deps/mochiweb/priv/skel/src/skel_sup.erl | 2 +- deps/menelaus/deps/mochiweb/src/mochijson.erl | 8 +- .../menelaus/deps/mochiweb/src/mochijson2.erl | 14 +- deps/menelaus/deps/mochiweb/src/mochinum.erl | 8 +- .../deps/mochiweb/src/mochiweb_charref.erl | 2 +- .../deps/mochiweb/src/mochiweb_cookies.erl | 22 +- .../deps/mochiweb/src/mochiweb_echo.erl | 2 +- .../deps/mochiweb/src/mochiweb_headers.erl | 4 +- .../deps/mochiweb/src/mochiweb_html.erl | 2 +- .../deps/mochiweb/src/mochiweb_skel.erl | 6 +- .../deps/mochiweb/src/mochiweb_util.erl | 2 +- deps/menelaus/doc/API/_layouts/default.html | 2 +- deps/menelaus/doc/API/css/default.css | 2 +- deps/menelaus/doc/API/index.markdown | 50 +- .../priv/js-unit-tests/test-helper.js | 2 +- deps/menelaus/priv/js/analytics.js | 2 +- deps/menelaus/priv/js/base64.js | 68 +-- deps/menelaus/priv/js/jqModal.js | 42 +- deps/menelaus/priv/js/jquery.ba-bbq.js | 450 +++++++++--------- deps/menelaus/priv/js/jquery.js | 256 +++++----- deps/menelaus/priv/js/less.js | 4 +- deps/menelaus/priv/js/less.min.js | 2 +- deps/menelaus/priv/js/manage-buckets.js | 4 +- deps/menelaus/priv/js/tools.tabs.js | 246 +++++----- deps/menelaus/priv/public/css/tabs.css | 34 +- deps/menelaus/src/diag_handler.erl | 4 +- deps/menelaus/src/menelaus_auth.erl | 2 +- 35 files changed, 636 insertions(+), 636 deletions(-) diff --git a/deps/menelaus/README.markdown b/deps/menelaus/README.markdown index 7f398dd5d6..45821a767d 100644 --- a/deps/menelaus/README.markdown +++ b/deps/menelaus/README.markdown @@ -1,6 +1,6 @@ # Menelaus -This OTP application represents the RESTful web service interface and the +This OTP application represents the RESTful web service interface and the management console to the world of ns_server and emoxi. ## Dependencies @@ -14,8 +14,8 @@ Rubygem cucumber ## Starting -The primary way to start Menelaus is to start it's parent project, the -ns_server. This way Menelaus fits into the supervisor hierarchy and +The primary way to start Menelaus is to start it's parent project, the +ns_server. This way Menelaus fits into the supervisor hierarchy and can make calls to ns_config as needed. diff --git a/deps/menelaus/deps/erlwsh/README b/deps/menelaus/deps/erlwsh/README index 6d94cdc36a..6ed5e469c7 100644 --- a/deps/menelaus/deps/erlwsh/README +++ b/deps/menelaus/deps/erlwsh/README @@ -13,8 +13,8 @@ Install: Then,compile all sources: make At last,you can start erlwsh by start.sh - ./start.sh - + ./start.sh + Erlwsh is online: http://localhost:8000/shell diff --git a/deps/menelaus/deps/erlwsh/scripts/install_mochiweb.sh b/deps/menelaus/deps/erlwsh/scripts/install_mochiweb.sh index e51e37ae01..d84d34407c 100644 --- a/deps/menelaus/deps/erlwsh/scripts/install_mochiweb.sh +++ b/deps/menelaus/deps/erlwsh/scripts/install_mochiweb.sh @@ -1,7 +1,7 @@ #! /bin/bash # author: litaocheng@gmail.com # date: 2009.10.16 -# desc: get the mochiweb from the google code svn, and install +# desc: get the mochiweb from the google code svn, and install # it to the erlang otp lib directory(makesure you have install # the erlang otp). # 1, get the erlang otp lib dir diff --git a/deps/menelaus/deps/erlwsh/src/erlwsh.erl b/deps/menelaus/deps/erlwsh/src/erlwsh.erl index a50ec6b9b3..d7e84344e9 100644 --- a/deps/menelaus/deps/erlwsh/src/erlwsh.erl +++ b/deps/menelaus/deps/erlwsh/src/erlwsh.erl @@ -14,7 +14,7 @@ ensure_started(App) -> {error, {already_started, App}} -> ok end. - + %% @spec start() -> ok %% @doc Start the erlwsh server. start() -> diff --git a/deps/menelaus/deps/erlwsh/src/erlwsh_deps.erl b/deps/menelaus/deps/erlwsh/src/erlwsh_deps.erl index c136e55077..58d6233f36 100644 --- a/deps/menelaus/deps/erlwsh/src/erlwsh_deps.erl +++ b/deps/menelaus/deps/erlwsh/src/erlwsh_deps.erl @@ -27,7 +27,7 @@ deps_on_path() -> end end, ordsets:from_list(lists:foldl(F, [], code:get_path())). - + %% @spec new_siblings(Module) -> [Dir] %% @doc Find new siblings paths relative to Module that aren't already on the %% code path. @@ -38,11 +38,11 @@ new_siblings(Module) -> ordsets:is_element( filename:basename(filename:dirname(X)), Existing) =:= false], - lists:filter(fun filelib:is_dir/1, + lists:filter(fun filelib:is_dir/1, lists:append([[filename:join([X, "ebin"]), filename:join([X, "include"])] || X <- Siblings])). - + %% @spec ensure(Module) -> ok %% @doc Ensure that all ebin and include paths for dependencies diff --git a/deps/menelaus/deps/erlwsh/src/erlwsh_sup.erl b/deps/menelaus/deps/erlwsh/src/erlwsh_sup.erl index 9b536a1bec..e26747800c 100644 --- a/deps/menelaus/deps/erlwsh/src/erlwsh_sup.erl +++ b/deps/menelaus/deps/erlwsh/src/erlwsh_sup.erl @@ -41,7 +41,7 @@ upgrade() -> %% @spec init([]) -> SupervisorTree %% @doc supervisor callback. init([]) -> - Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end, + Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end, WebConfig = [ {ip, Ip}, {port, 8000}, diff --git a/deps/menelaus/deps/mochiweb/priv/skel/src/skel.erl b/deps/menelaus/deps/mochiweb/priv/skel/src/skel.erl index 49263c8016..7ac4e2bc2a 100644 --- a/deps/menelaus/deps/mochiweb/priv/skel/src/skel.erl +++ b/deps/menelaus/deps/mochiweb/priv/skel/src/skel.erl @@ -14,7 +14,7 @@ ensure_started(App) -> {error, {already_started, App}} -> ok end. - + %% @spec start() -> ok %% @doc Start the skel server. start() -> diff --git a/deps/menelaus/deps/mochiweb/priv/skel/src/skel_deps.erl b/deps/menelaus/deps/mochiweb/priv/skel/src/skel_deps.erl index b53552d750..59f07124e8 100644 --- a/deps/menelaus/deps/mochiweb/priv/skel/src/skel_deps.erl +++ b/deps/menelaus/deps/mochiweb/priv/skel/src/skel_deps.erl @@ -27,7 +27,7 @@ deps_on_path() -> end end, ordsets:from_list(lists:foldl(F, [], code:get_path())). - + %% @spec new_siblings(Module) -> [Dir] %% @doc Find new siblings paths relative to Module that aren't already on the %% code path. @@ -38,11 +38,11 @@ new_siblings(Module) -> ordsets:is_element( filename:basename(filename:dirname(X)), Existing) =:= false], - lists:filter(fun filelib:is_dir/1, + lists:filter(fun filelib:is_dir/1, lists:append([[filename:join([X, "ebin"]), filename:join([X, "include"])] || X <- Siblings])). - + %% @spec ensure(Module) -> ok %% @doc Ensure that all ebin and include paths for dependencies diff --git a/deps/menelaus/deps/mochiweb/priv/skel/src/skel_sup.erl b/deps/menelaus/deps/mochiweb/priv/skel/src/skel_sup.erl index 92e0caef3a..bed6b4585b 100644 --- a/deps/menelaus/deps/mochiweb/priv/skel/src/skel_sup.erl +++ b/deps/menelaus/deps/mochiweb/priv/skel/src/skel_sup.erl @@ -41,7 +41,7 @@ upgrade() -> %% @spec init([]) -> SupervisorTree %% @doc supervisor callback. init([]) -> - Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end, + Ip = case os:getenv("MOCHIWEB_IP") of false -> "0.0.0.0"; Any -> Any end, WebConfig = [ {ip, Ip}, {port, 8000}, diff --git a/deps/menelaus/deps/mochiweb/src/mochijson.erl b/deps/menelaus/deps/mochiweb/src/mochijson.erl index d0e301d216..74695a75ee 100644 --- a/deps/menelaus/deps/mochiweb/src/mochijson.erl +++ b/deps/menelaus/deps/mochiweb/src/mochijson.erl @@ -145,7 +145,7 @@ json_encode_proplist([], _State) -> "{}"; json_encode_proplist(Props, State) -> F = fun ({K, V}, Acc) -> - KS = case K of + KS = case K of K when is_atom(K) -> json_encode_string_utf8(atom_to_list(K)); K when is_integer(K) -> @@ -321,12 +321,12 @@ tokenize_string([$\\, $u, C3, C2, C1, C0 | Rest], S, Acc) -> % coalesce UTF-16 surrogate pair? C = dehex(C0) bor (dehex(C1) bsl 4) bor - (dehex(C2) bsl 8) bor + (dehex(C2) bsl 8) bor (dehex(C3) bsl 12), tokenize_string(Rest, ?ADV_COL(S, 6), [C | Acc]); tokenize_string([C | Rest], S, Acc) when C >= $\s; C < 16#10FFFF -> tokenize_string(Rest, ?ADV_COL(S, 1), [C | Acc]). - + tokenize_number(IoList=[C | _], Mode, S=#decoder{input_encoding=utf8}, Acc) when is_list(C); is_binary(C); C >= 16#7f -> List = xmerl_ucs:from_utf8(iolist_to_binary(IoList)), @@ -419,7 +419,7 @@ is_obj({struct, Props}) -> true; (_) -> false - end, + end, lists:all(F, Props). obj_from_list(Props) -> diff --git a/deps/menelaus/deps/mochiweb/src/mochijson2.erl b/deps/menelaus/deps/mochiweb/src/mochijson2.erl index 42ad9e1f2a..66f68bf084 100644 --- a/deps/menelaus/deps/mochiweb/src/mochijson2.erl +++ b/deps/menelaus/deps/mochiweb/src/mochijson2.erl @@ -523,7 +523,7 @@ is_obj({struct, Props}) -> true; (_) -> false - end, + end, lists:all(F, Props). obj_from_list(Props) -> @@ -606,21 +606,21 @@ e2j_test_vec(utf8) -> {[], "[]"}, {[[]], "[[]]"}, {[1, <<"foo">>], "[1,\"foo\"]"}, - + %% json array in a json object {obj_from_list([{<<"foo">>, [123]}]), "{\"foo\":[123]}"}, - + %% json object in a json object {obj_from_list([{<<"foo">>, obj_from_list([{<<"bar">>, true}])}]), "{\"foo\":{\"bar\":true}}"}, - + %% fold evaluation order {obj_from_list([{<<"foo">>, []}, {<<"bar">>, obj_from_list([{<<"baz">>, true}])}, {<<"alice">>, <<"bob">>}]), "{\"foo\":[],\"bar\":{\"baz\":true},\"alice\":\"bob\"}"}, - + %% json object in a json array {[-123, <<"foo">>, obj_from_list([{<<"bar">>, []}]), null], "[-123,\"foo\",{\"bar\":[]},null]"} @@ -629,7 +629,7 @@ e2j_test_vec(utf8) -> %% test utf8 encoding test_encoder_utf8() -> %% safe conversion case (default) - [34,"\\u0001","\\u0442","\\u0435","\\u0441","\\u0442",34] = + [34,"\\u0001","\\u0442","\\u0435","\\u0441","\\u0442",34] = encode(<<1,"\321\202\320\265\321\201\321\202">>), %% raw utf8 output (optional) @@ -647,7 +647,7 @@ test_input_validation() -> Expect = list_to_binary(xmerl_ucs:to_utf8(CodePoint)), Expect = decode(UTF8) end, Good), - + Bad = [ % 2nd, 3rd, or 4th byte of a multi-byte sequence w/o leading byte <>, diff --git a/deps/menelaus/deps/mochiweb/src/mochinum.erl b/deps/menelaus/deps/mochiweb/src/mochinum.erl index 4f88f9a514..6a866042bb 100644 --- a/deps/menelaus/deps/mochiweb/src/mochinum.erl +++ b/deps/menelaus/deps/mochiweb/src/mochinum.erl @@ -40,7 +40,7 @@ digits(Float) -> _ -> R end. - + %% @spec frexp(F::float()) -> {Frac::float(), Exp::float()} %% @doc Return the fractional and exponent part of an IEEE 754 double, %% equivalent to the libc function of the same name. @@ -205,7 +205,7 @@ generate(R0, S, MPlus, MMinus, LowOk, HighOk) -> end end. -unpack(Float) -> +unpack(Float) -> <> = <>, {Sign, Exp, Frac}. @@ -243,7 +243,7 @@ test_int_ceil() -> -1 = int_ceil(-1.5), -2 = int_ceil(-2.0), ok. - + test_int_pow() -> 1 = int_pow(1, 1), 1 = int_pow(1, 0), @@ -252,7 +252,7 @@ test_int_pow() -> 100 = int_pow(10, 2), 1000 = int_pow(10, 3), ok. - + test_digits() -> "0" = digits(0), "0.0" = digits(0.0), diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_charref.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_charref.erl index 59fd4a47be..d037d2f8c3 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_charref.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_charref.erl @@ -26,7 +26,7 @@ charref([$# | L]) -> end; charref(L) -> entity(L). - + %% @spec test() -> ok %% @doc Run tests for mochiweb_charref. test() -> diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_cookies.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_cookies.erl index a5a7f37481..61711ff038 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_cookies.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_cookies.erl @@ -29,8 +29,8 @@ cookie(Key, Value) -> cookie(Key, Value, []). -%% @spec cookie(Key::string(), Value::string(), Options::[Option]) -> header() -%% where Option = {max_age, integer()} | {local_time, {date(), time()}} +%% @spec cookie(Key::string(), Value::string(), Options::[Option]) -> header() +%% where Option = {max_age, integer()} | {local_time, {date(), time()}} %% | {domain, string()} | {path, string()} %% | {secure, true | false} | {http_only, true | false} %% @@ -125,9 +125,9 @@ age_to_cookie_date(Age, LocalTime) -> %% @spec parse_cookie(string()) -> [{K::string(), V::string()}] %% @doc Parse the contents of a Cookie header field, ignoring cookie %% attributes, and return a simple property list. -parse_cookie("") -> +parse_cookie("") -> []; -parse_cookie(Cookie) -> +parse_cookie(Cookie) -> parse_cookie(Cookie, []). %% @spec test() -> ok @@ -140,8 +140,8 @@ test() -> %% Internal API parse_cookie([], Acc) -> - lists:reverse(Acc); -parse_cookie(String, Acc) -> + lists:reverse(Acc); +parse_cookie(String, Acc) -> {{Token, Value}, Rest} = read_pair(String), Acc1 = case Token of "" -> @@ -180,7 +180,7 @@ read_quoted([$\\, Any | Rest], Acc) -> read_quoted(Rest, [Any | Acc]); read_quoted([C | Rest], Acc) -> read_quoted(Rest, [C | Acc]). - + skip_whitespace(String) -> F = fun (C) -> ?IS_WHITESPACE(C) end, lists:dropwhile(F, String). @@ -189,7 +189,7 @@ read_token(String) -> F = fun (C) -> not ?IS_SEPARATOR(C) end, lists:splitwith(F, String). -skip_past_separator([]) -> +skip_past_separator([]) -> []; skip_past_separator([$; | Rest]) -> Rest; @@ -200,7 +200,7 @@ skip_past_separator([_ | Rest]) -> parse_cookie_test() -> %% RFC example - C1 = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"; + C1 = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"; Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\"; Shipping=\"FedEx\"; $Path=\"/acme\"", [ @@ -238,8 +238,8 @@ cookie_test() -> C1 = cookie(<<"Customer">>, <<"WILE_E_COYOTE">>, [{path, <<"/acme">>}]), {"Set-Cookie","=NoKey; Version=1"} = cookie("", "NoKey", []), - - LocalTime = calendar:universal_time_to_local_time({{2007, 5, 15}, {13, 45, 33}}), + + LocalTime = calendar:universal_time_to_local_time({{2007, 5, 15}, {13, 45, 33}}), C2 = {"Set-Cookie", "Customer=WILE_E_COYOTE; " "Version=1; " diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_echo.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_echo.erl index f0c455a580..f32d6803b9 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_echo.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_echo.erl @@ -9,7 +9,7 @@ stop() -> mochiweb_socket_server:stop(?MODULE). - + start() -> mochiweb_socket_server:start([{name, ?MODULE}, {port, 6789}, diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_headers.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_headers.erl index 576b6438ac..6fcec7c3f9 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_headers.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_headers.erl @@ -19,7 +19,7 @@ %% @doc Run tests for this module. test() -> H = ?MODULE:make([{hdr, foo}, {"Hdr", "bar"}, {'Hdr', 2}]), - [{hdr, "foo, bar, 2"}] = ?MODULE:to_list(H), + [{hdr, "foo, bar, 2"}] = ?MODULE:to_list(H), H1 = ?MODULE:insert(taco, grande, H), [{hdr, "foo, bar, 2"}, {taco, "grande"}] = ?MODULE:to_list(H1), H2 = ?MODULE:make([{"Set-Cookie", "foo"}]), @@ -69,7 +69,7 @@ default_from_list(List, T) -> %% @spec to_list(headers()) -> [{key(), string()}] %% @doc Return the contents of the headers. The keys will be the exact key -%% that was first inserted (e.g. may be an atom or binary, case is +%% that was first inserted (e.g. may be an atom or binary, case is %% preserved). to_list(T) -> F = fun ({K, {array, L}}, Acc) -> diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_html.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_html.erl index b4c81385e1..77100d5038 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_html.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_html.erl @@ -552,7 +552,7 @@ tree([T={comment, _Comment} | Rest], S) -> tree(Rest, append_stack_child(T, S)); tree(L=[{data, _Data, _Whitespace} | _], S) -> case tree_data(L, true, []) of - {_, true, Rest} -> + {_, true, Rest} -> tree(Rest, S); {Data, false, Rest} -> tree(Rest, append_stack_child(Data, S)) diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_skel.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_skel.erl index b4ab1812a6..f4641faedf 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_skel.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_skel.erl @@ -7,7 +7,7 @@ skelcopy(DestDir, Name) -> ok = ensuredir(DestDir), - LDst = case length(filename:dirname(DestDir)) of + LDst = case length(filename:dirname(DestDir)) of 1 -> %% handle case when dirname returns "/" 0; N -> @@ -17,7 +17,7 @@ skelcopy(DestDir, Name) -> ok = file:make_symlink( filename:join(filename:dirname(code:which(?MODULE)), ".."), filename:join([DestDir, Name, "deps", "mochiweb"])). - + %% Internal API @@ -41,7 +41,7 @@ skelcopy(Src, DestDir, Name, LDst) -> io:format("~s/~n", [EDst]), lists:foreach(fun ("." ++ _) -> ok; (F) -> - skelcopy(filename:join(Src, F), + skelcopy(filename:join(Src, F), Dir, Name, LDst) diff --git a/deps/menelaus/deps/mochiweb/src/mochiweb_util.erl b/deps/menelaus/deps/mochiweb/src/mochiweb_util.erl index e78da56e63..7236995661 100644 --- a/deps/menelaus/deps/mochiweb/src/mochiweb_util.erl +++ b/deps/menelaus/deps/mochiweb/src/mochiweb_util.erl @@ -419,7 +419,7 @@ record_to_proplist(Record, Fields) -> record_to_proplist(Record, Fields, '__record'). %% @spec record_to_proplist(Record, Fields, TypeKey) -> proplist() -%% @doc Return a proplist of the given Record with each field in the +%% @doc Return a proplist of the given Record with each field in the %% Fields list set as a key with the corresponding value in the Record. %% TypeKey is the key that is used to store the record type %% Fields should be obtained by calling record_info(fields, record_type) diff --git a/deps/menelaus/doc/API/_layouts/default.html b/deps/menelaus/doc/API/_layouts/default.html index 42c75e7e9b..d12f16b131 100644 --- a/deps/menelaus/doc/API/_layouts/default.html +++ b/deps/menelaus/doc/API/_layouts/default.html @@ -5,7 +5,7 @@ -
+
{{ content }}
diff --git a/deps/menelaus/doc/API/css/default.css b/deps/menelaus/doc/API/css/default.css index faabaec453..7b62d38094 100644 --- a/deps/menelaus/doc/API/css/default.css +++ b/deps/menelaus/doc/API/css/default.css @@ -1,4 +1,4 @@ -code +code { margin-top: 0.4em; margin-right: 0pt; diff --git a/deps/menelaus/doc/API/index.markdown b/deps/menelaus/doc/API/index.markdown index 71d89fb903..ca6a3a3eaa 100644 --- a/deps/menelaus/doc/API/index.markdown +++ b/deps/menelaus/doc/API/index.markdown @@ -134,7 +134,7 @@ RESTful endpoints in the representation of the item one would control. * Pool - A collection of physical resources grouped together and providing services. A member of a pool is a Node. Pools were later renamed to "clusters" (and the previous concept of cluster changed) so this document may refer to either. - * _Statistics_ - Pools provide an overall pool level data view of counters + * _Statistics_ - Pools provide an overall pool level data view of counters and periodic metrics of the overall system. (note, this is missing in version 1.6) * Node - A system within a pool. Nodes may provide Node-local representations of a service, but are also required to provide or proxy Pool level resources. @@ -252,7 +252,7 @@ transitions to the client, if backward compatibility is desirable. HTTP/1.1 200 OK Content-Type: application/com.northscale.store+json Content-Length: nnn - + { "name":"default", "nodes":[{ @@ -316,7 +316,7 @@ transitions to the client, if backward compatibility is desirable. "uri":"/pools/default/stats" } } - + At the highest level, a pool describes a cluster (as mentioned above). This @@ -328,17 +328,17 @@ the default bucket for a pool is, the system will attempt to connect non-SASL, non-proxied to a bucket clients to a bucket named "default". If it does not exist, the connection will be dropped. -Clients MUST NOT rely on the node list here to create their "server list" for -when connecting. They MUST instead issue an HTTP get call to the bucket to +Clients MUST NOT rely on the node list here to create their "server list" for +when connecting. They MUST instead issue an HTTP get call to the bucket to get the node list for that specific bucket. The controllers, all of which accept parameters as x-www-form-urlencoded, for this list perform the following functions: *ejectNode* - Eject a node from the cluster. Required parameter: -"otpNode", the node to be ejected. +"otpNode", the node to be ejected. *addNode* - Add a node to this cluster. Required parameters: "hostname", -"user" (which is the admin user for the node), and "password". +"user" (which is the admin user for the node), and "password". *rebalance* - Rebalance the existing cluster. This controller is either used without any parameters or requires both "knownNodes" and "ejectedNodes". When used with parameters, this allows a client to state the existing known nodes @@ -347,21 +347,21 @@ operation. To ensure no cluster state changes have occured since a client last got a list of nodes, both the known nodes and the node to be ejected must be supplied. If the list does not match the set of nodes, the request will fail with an HTTP 400 indicating a mismatch. Note -rebalance progress is available via the rebalanceProgress uri. +rebalance progress is available via the rebalanceProgress uri. *failover* - Failover the vbuckets from a given node to the nodes which have replicas of data for those vbuckets. The "otpNode" parameter is required and -specifies the node to be failed over. +specifies the node to be failed over. *reAddNode* - The "otpNode" parameter is required and specifies the node to be -re-added. +re-added. *stopRebalance* - Stop any rebalance operation currently running. -This takes no parameters. +This takes no parameters. The list of nodes will list each node in the cluster. It will, additionally, list some attributes of the nodes. } ] - -Clients to the system can choose to use either the proxy path or the direct -path. If they use the direct path, they will not be insulated from most -reconfiguration changes to the bucket. This means they will need to -either poll the bucket's URI or connect to the streamingUri to receive -updates when the bucket configuration changes. This happens, for instance, + +Clients to the system can choose to use either the proxy path or the direct +path. If they use the direct path, they will not be insulated from most +reconfiguration changes to the bucket. This means they will need to +either poll the bucket's URI or connect to the streamingUri to receive +updates when the bucket configuration changes. This happens, for instance, when nodes are added, removed, or may fall into an unhealthy state. #### Named Bucket and Bucket Streaming URI @@ -501,18 +501,18 @@ when nodes are added, removed, or may fall into an unhealthy state. "stats": { "uri" : "/pools/default/buckets/default/stats" } } } - -The individual bucket request is exactly the same as what would be + +The individual bucket request is exactly the same as what would be obtained from the item in the array for the entire buckets list above. The streamingUri is exactly the same except it streams HTTP chunks using -chunked encoding. A response of "\n\n\n\n" delimits chunks. This will -likely be converted to a "zero chunk" in a future release of this API, and +chunked encoding. A response of "\n\n\n\n" delimits chunks. This will +likely be converted to a "zero chunk" in a future release of this API, and thus the behavior of the streamingUri should be considered evolving. #### Flushing a bucket -The bucket details provide a bucket URI at which a simple request can be +The bucket details provide a bucket URI at which a simple request can be made to flush the bucket.
@@ -528,7 +528,7 @@ by the service.  The simple requirement is for a POST with an appropriate
 `Authorization` header, if the system is secured.
 
 The response will be a simple `204 No Content` if the flush is successful
-and a `404 Not Found` if the URI is invalid or does not correspond to a 
+and a `404 Not Found` if the URI is invalid or does not correspond to a
 bucket the system is familiar with.
 
 #### Deleting a bucket
@@ -942,7 +942,7 @@ have been referenced.
 * 20091207 Removed default bucket, removed ID/GUIDs from buckets/pools, changed
   bucket rules to be single value cache range rather than persist range.  Added
   bucket renaming. (matt.ingenthron@northscale.com)
-* 20091208 Added bucket level preferred port configuration to RESTful 
+* 20091208 Added bucket level preferred port configuration to RESTful
   interface. (matt.ingenthron@northscale.com)
 * 20091210 Moved to camelCase for JSON object names.  Added restrictions on
   pool and bucket names.  (matt.ingenthron@northscale.com)
diff --git a/deps/menelaus/priv/js-unit-tests/test-helper.js b/deps/menelaus/priv/js-unit-tests/test-helper.js
index 42b4f84470..8b25e2aaf0 100644
--- a/deps/menelaus/priv/js-unit-tests/test-helper.js
+++ b/deps/menelaus/priv/js-unit-tests/test-helper.js
@@ -79,7 +79,7 @@ function assertInclusion(msg, item, set) {
 function assertSetEquals(set1, set2) {
   set1 = _.toArray(set1);
   set2 = _.toArray(set2);
-  assertEquals("set{1,2}.length", set1.length, set2.length); 
+  assertEquals("set{1,2}.length", set1.length, set2.length);
   var missing = [];
   _.each(set1, function (e, i) {
     if (!_.include(set2, e))
diff --git a/deps/menelaus/priv/js/analytics.js b/deps/menelaus/priv/js/analytics.js
index 00c3ebe3c3..695dbd6199 100644
--- a/deps/menelaus/priv/js/analytics.js
+++ b/deps/menelaus/priv/js/analytics.js
@@ -216,7 +216,7 @@ var KnownStats = [
   ["cas_misses", "CAS misses per second"]
   // ["ep_flusher_todo", "EP-flusher todo"],
   // ["ep_queue_size", "EP queue size"],
-  // ["updates", "Updates per second\nSum of set, increment, decrement, cas and delete operations per second"], 
+  // ["updates", "Updates per second\nSum of set, increment, decrement, cas and delete operations per second"],
 ];
 
 var StatGraphs = {
diff --git a/deps/menelaus/priv/js/base64.js b/deps/menelaus/priv/js/base64.js
index 74957a211d..e9388dfa35 100644
--- a/deps/menelaus/priv/js/base64.js
+++ b/deps/menelaus/priv/js/base64.js
@@ -9,90 +9,90 @@
 // also utf8 handling functions are not really utf8, but CESU-8.
 // I.e. it doesn't handle utf16 surrogate pairs at all
 var Base64 = {
- 
+
 	// private property
 	_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
- 
+
 	// public method for encoding
 	encode : function (input) {
 		var output = "";
 		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
 		var i = 0;
- 
+
 		input = Base64._utf8_encode(input);
- 
+
 		while (i < input.length) {
- 
+
 			chr1 = input.charCodeAt(i++);
 			chr2 = input.charCodeAt(i++);
 			chr3 = input.charCodeAt(i++);
- 
+
 			enc1 = chr1 >> 2;
 			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
 			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
 			enc4 = chr3 & 63;
- 
+
 			if (isNaN(chr2)) {
 				enc3 = enc4 = 64;
 			} else if (isNaN(chr3)) {
 				enc4 = 64;
 			}
- 
+
 			output = output +
 			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
 			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
- 
+
 		}
- 
+
 		return output;
 	},
- 
+
 	// public method for decoding
 	decode : function (input) {
 		var output = "";
 		var chr1, chr2, chr3;
 		var enc1, enc2, enc3, enc4;
 		var i = 0;
- 
+
 		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
- 
+
 		while (i < input.length) {
- 
+
 			enc1 = this._keyStr.indexOf(input.charAt(i++));
 			enc2 = this._keyStr.indexOf(input.charAt(i++));
 			enc3 = this._keyStr.indexOf(input.charAt(i++));
 			enc4 = this._keyStr.indexOf(input.charAt(i++));
- 
+
 			chr1 = (enc1 << 2) | (enc2 >> 4);
 			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
 			chr3 = ((enc3 & 3) << 6) | enc4;
- 
+
 			output = output + String.fromCharCode(chr1);
- 
+
 			if (enc3 != 64) {
 				output = output + String.fromCharCode(chr2);
 			}
 			if (enc4 != 64) {
 				output = output + String.fromCharCode(chr3);
 			}
- 
+
 		}
- 
+
 		output = Base64._utf8_decode(output);
- 
+
 		return output;
- 
+
 	},
- 
+
 	// private method for UTF-8 encoding
 	_utf8_encode : function (string) {
 //		string = string.replace(/\r\n/g,"\n");
 		var utftext = "";
- 
+
 		for (var n = 0; n < string.length; n++) {
- 
+
 			var c = string.charCodeAt(n);
- 
+
 			if (c < 128) {
 				utftext += String.fromCharCode(c);
 			}
@@ -105,22 +105,22 @@ var Base64 = {
 				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
 				utftext += String.fromCharCode((c & 63) | 128);
 			}
- 
+
 		}
- 
+
 		return utftext;
 	},
- 
+
 	// private method for UTF-8 decoding
 	_utf8_decode : function (utftext) {
 		var string = "";
 		var i = 0;
 		var c = c1 = c2 = 0;
- 
+
 		while ( i < utftext.length ) {
- 
+
 			c = utftext.charCodeAt(i);
- 
+
 			if (c < 128) {
 				string += String.fromCharCode(c);
 				i++;
@@ -136,10 +136,10 @@ var Base64 = {
 				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
 				i += 3;
 			}
- 
+
 		}
- 
+
 		return string;
 	}
- 
+
 }
diff --git a/deps/menelaus/priv/js/jqModal.js b/deps/menelaus/priv/js/jqModal.js
index 47d87feff9..4345c9d5f9 100644
--- a/deps/menelaus/priv/js/jqModal.js
+++ b/deps/menelaus/priv/js/jqModal.js
@@ -4,7 +4,7 @@
  * Copyright (c) 2007 Brice Burgess , http://www.iceburg.net
  * Licensed under the MIT License:
  * http://www.opensource.org/licenses/mit-license.php
- * 
+ *
  * $Version: 2007.??.?? +r12 beta
  * Requires: jQuery 1.1.3+
  */
@@ -14,11 +14,11 @@
  * notices, modal windows, and image containers. An expando ("_jqm") containing
  * the UUID or "serial" of the modal is added to each element. This expando helps
  * reference the modal's settings in the jqModal Hash Object (jQuery.jqm.hash)
- * 
+ *
  * Accepts a parameter object with the following modal settings;
- * 
- * (Integer) zIndex - Desired z-Index of the modal. This setting does not override (has no effect on) preexisting z-Index styling (set via CSS or inline style).  
- * (Integer) overlay - [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay.  
+ *
+ * (Integer) zIndex - Desired z-Index of the modal. This setting does not override (has no effect on) preexisting z-Index styling (set via CSS or inline style).
+ * (Integer) overlay - [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay.
  * (String) overlayClass - This class is applied to the body covering overlay. Allows CSS control of the overlay look (tint, background image, etc.).
  * (String) closeClass - A close trigger is added to all elements matching this class within the modal.
  * (Mixed) trigger - An open trigger is added to all matching elements within the DOM. Trigger can be a selector String, a jQuery collection of elements, a DOM element, or a False boolean.
@@ -59,7 +59,7 @@ onLoad: false
 //    *AND*...
 return this.each(function(){if(this._jqm)return;s++;this._jqm=s;
 
-// ... Add this element's serial to the jqModal Hash Object 
+// ... Add this element's serial to the jqModal Hash Object
 //  Hash is globally accessible via jQuery.jqm.hash. It consists of;
 //   c: {obj} config/options
 //   a: {bool} active state (true: active/visible, false: inactive/hidden)
@@ -74,7 +74,7 @@ o.trigger&&$(this).jqmAddTrigger(o.trigger);
 });};
 
 // Adds behavior to triggering elements via the hide-show (HS) function.
-// 
+//
 $.fn.jqmAddClose=function(e){return HS(this,e,'jqmHide');};
 $.fn.jqmAddTrigger=function(e){return HS(this,e,'jqmShow');};
 
@@ -98,23 +98,23 @@ hash:{},
 // mark this modal as active (h.a === true)
 // set the triggering object (h.t) and the modal's z-Index.
 open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=/^\d+$/.test(h.w.css('z-index'))&&h.w.css('z-index')||c.zIndex,o=$('
').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});h.t=t;h.a=true;h.w.css('z-index',z); - + // IF the modal argument was passed as true; // Bind the Keep Focus Function if no other Modals are open (!A[0]), // Add this modal to the opened modals stack (A) for nested modal support, // and Mark overlay to show wait cursor when mouse hovers over it. if(c.modal) {!A[0]&&F('bind');A.push(s);o.css('cursor','wait');} - + // ELSE IF an overlay was requested (translucency set greater than 0); // Attach a Close event to overlay to hide modal when overlay is clicked. else if(c.overlay > 0)h.w.jqmAddClose(o); - + // ELSE disable the overlay else o=false; // Add the Overlay to BODY if not disabled. h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):false; - + // IF IE6; // Set the Overlay to 100% height/width, and fix-position it via JS workaround if(ie6&&$('html,body').css({height:'100%',width:'100%'})&&o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(document.documentElement.scroll"+y+" || document.body.scroll"+y+")+'px'");} @@ -123,13 +123,13 @@ open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=/^\d+$/.test(h.w.css(' // determine the target element {JQ} to recieve content (r), // determine the URL {STR} to load content from (u) if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u; - + // Load the Content (and once loaded); // Fire the onLoad callback (if exists), // Attach closing events to elements inside the modal that match the closingClass, // and Execute the jqModal default Open Callback r.load(u,function(){c.onLoad&&c.onLoad.call(this,h);cc&&h.w.jqmAddClose($(cc,h.w));O(h);});} - + // ELSE the modal content is NOT to be loaded via ajax; // Attach closing events to elements inside the modal that match the closingClass else cc&&h.w.jqmAddClose($(cc,h.w)); @@ -137,13 +137,13 @@ open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=/^\d+$/.test(h.w.css(' // IF toTop was passed and an overlay exists; // Remember the DOM posistion of the modal by inserting a tagged (matching serial) before the modal // Move the Modal from its current position to a first child of the body tag (after the overlay) - c.toTop&&h.o&&h.w.before('').insertAfter(h.o); - + c.toTop&&h.o&&h.w.before('').insertAfter(h.o); + // Execute user defined onShow callback, or else show (make visible) the modal. // Execute the jqModal default Open Callback. // Return false to prevent trigger click from being followed. (c.onShow)?c.onShow(h):h.w.show();O(h);return false; - + }, // Function is executed by $.jqmHide to hide a modal @@ -152,11 +152,11 @@ close:function(s){var h=H[s];h.a=false; // If modal, remove from modal stack. // If no modals in modal stack, unbind the Keep Focus Function if(h.c.modal){A.pop();!A[0]&&F('unbind');} - + // IF toTop was passed and an overlay exists; // Move modal back to its previous ("remembered") position. h.c.toTop&&h.o&&$('#jqmP'+h.w[0]._jqm).after(h.w).remove(); - + // Execute user defined onHide callback, or else hide (make invisible) the modal and remove the overlay. if(h.c.onHide)h.c.onHide(h);else{h.w.hide()&&h.o&&h.o.remove()}return false; }}; @@ -191,10 +191,10 @@ F=function(t){$()[t]("keypress",x)[t]("keydown",x)[t]("mousedown",x);}, // ELSE if so (r===false); follow event (return true [!false]) x=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);r&&f(h);return !r;}, -// hide-show function; assigns click events to trigger elements that +// hide-show function; assigns click events to trigger elements that // hide, show, or hide AND show modals. -// Expandos (jqmShow and/or jqmHide) are added to all trigger elements. +// Expandos (jqmShow and/or jqmHide) are added to all trigger elements. // These Expandos hold an array of modal serials {INT} to show or hide. // w: {DOM Element} The modal element (window/dialog/notice/etc. container) @@ -207,7 +207,7 @@ HS=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)}); // for each triggering element attach the jqmHide or jqmShow expando (y) // or else expand the expando with the current serial array $(e).each(function(){if(this[y])$.extend(this[y],s); - + // Assign a click event on the trigger element which examines the element's // jqmHide/Show expandos and attempts to execute $.jqmHide/Show on matching modals else{this[y]=s;$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false;});}});return w;}; diff --git a/deps/menelaus/priv/js/jquery.ba-bbq.js b/deps/menelaus/priv/js/jquery.ba-bbq.js index f9e69895b3..718ec592ae 100644 --- a/deps/menelaus/priv/js/jquery.ba-bbq.js +++ b/deps/menelaus/priv/js/jquery.ba-bbq.js @@ -1,7 +1,7 @@ /*! * jQuery BBQ: Back Button & Query Library - v1.0.2 - 10/10/2009 * http://benalman.com/projects/jquery-bbq-plugin/ - * + * * Copyright (c) 2009 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ @@ -10,40 +10,40 @@ // Script: jQuery BBQ: Back Button & Query Library // // *Version: 1.0.2, Last updated: 10/10/2009* -// +// // Project Home - http://benalman.com/projects/jquery-bbq-plugin/ // GitHub - http://github.com/cowboy/jquery-bbq/ // Source - http://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.js // (Minified) - http://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.min.js (3.1kb) -// +// // About: License -// +// // Copyright (c) 2009 "Cowboy" Ben Alman, // Dual licensed under the MIT and GPL licenses. // http://benalman.com/about/license/ -// +// // About: Examples -// +// // These working examples, complete with fully commented code, illustrate a few // ways in which this plugin can be used. -// +// // Basic AJAX - http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/ // Advanced AJAX - http://benalman.com/code/projects/jquery-bbq/examples/fragment-advanced/ // jQuery UI Tabs - http://benalman.com/code/projects/jquery-bbq/examples/fragment-jquery-ui-tabs/ // Deparam - http://benalman.com/code/projects/jquery-bbq/examples/deparam/ -// +// // About: Support and Testing -// +// // Information about what version or versions of jQuery this plugin has been // tested with, what browsers it has been tested in, and where the unit tests // reside (so you can test it yourself). -// +// // jQuery Versions - 1.3.2, 1.4pre // Browsers Tested - Internet Explorer 6-8, Firefox 2-3.7, Safari 3-4, Chrome, Opera 9.6-10. // Unit Tests - http://benalman.com/code/projects/jquery-bbq/unit/ -// +// // About: Release History -// +// // 1.0.2 - (10/10/2009) Fixed an issue in IE 6/7 where the hidden IFRAME caused // a "This page contains both secure and nonsecure items." warning when // used on an https:// page. @@ -55,13 +55,13 @@ (function($,window){ '$:nomunge'; // Used by YUI compressor. - + // Some convenient shortcuts. var undefined, loc = document.location, aps = Array.prototype.slice, decode = decodeURIComponent, - + // Method references. jq_param = $.param, jq_param_fragment, @@ -71,7 +71,7 @@ jq_bbq_pushState, jq_elemUrlAttr, fake_onhashchange, - + // Reused strings. str_hashchange = 'hashchange', str_querystring = 'querystring', @@ -80,69 +80,69 @@ str_elemUrlAttr = 'elemUrlAttr', str_href = 'href', str_src = 'src', - + browser = $.browser, is_old_ie = browser.msie && browser.version < 8, - + // Does the browser support window.onhashchange? Test for IE version, since // IE8 incorrectly reports this when in "IE7" or "IE8 Compatibility View"! supports_onhashchange = 'on' + str_hashchange in window && !is_old_ie, - + // Reused RegExp. re_trim_querystring = /^.*\?|#.*$/g, re_trim_fragment = /^.*\#/, - + // Used by jQuery.elemUrlAttr. elemUrlAttr_cache = {}; - + // A few commonly used bits, broken out to help reduce minified file size. - + function is_string( arg ) { return typeof arg === 'string'; }; - + // Why write the same function twice? Let's curry! Mmmm, curry.. - + function curry( func ) { var args = aps.call( arguments, 1 ); - + return function() { return func.apply( this, args.concat( aps.call( arguments ) ) ); }; }; - + // Section: Param (to string) - // + // // Method: jQuery.param.querystring - // + // // Retrieve the query string from a URL or if no arguments are passed, the // current document.location. - // + // // Usage: - // + // // > jQuery.param.querystring( [ url ] ); - // + // // Arguments: - // + // // url - (String) A URL containing query string params to be parsed. If url // is not passed, the current document.location is used. - // + // // Returns: - // + // // (String) The parsed query string, with any leading "?" removed. // - + // Method: jQuery.param.querystring (build url) - // + // // Merge a URL, with or without pre-existing query string params, plus any // object, params string or URL containing query string params into a new URL. - // + // // Usage: - // + // // > jQuery.param.querystring( url, params [, merge_mode ] ); - // + // // Arguments: - // + // // url - (String) A valid URL for params to be merged into. This URL may // contain a query string and/or fragment (hash). // params - (String) A params string or URL containing query string params to @@ -150,48 +150,48 @@ // params - (Object) A params object to be merged into url. // merge_mode - (Number) Merge behavior defaults to 0 if merge_mode is not // specified, and is as-follows: - // + // // * 0: params in the params argument will override any query string // params in url. // * 1: any query string params in url will override params in the params // argument. // * 2: params argument will completely replace any query string in url. - // + // // Returns: - // + // // (String) Either a params string with urlencoded data or a URL with a // urlencoded query string in the format 'a=b&c=d&e=f'. - + // Method: jQuery.param.fragment - // + // // Retrieve the fragment (hash) from a URL or if no arguments are passed, the // current document.location. - // + // // Usage: - // + // // > jQuery.param.fragment( [ url ] ); - // + // // Arguments: - // + // // url - (String) A URL containing fragment (hash) params to be parsed. If // url is not passed, the current document.location is used. - // + // // Returns: - // + // // (String) The parsed fragment (hash) string, with any leading "#" removed. - + // Method: jQuery.param.fragment (build url) - // + // // Merge a URL, with or without pre-existing fragment (hash) params, plus any // object, params string or URL containing fragment (hash) params into a new // URL. - // + // // Usage: - // + // // > jQuery.param.fragment( url, params [, merge_mode ] ); - // + // // Arguments: - // + // // url - (String) A valid URL for params to be merged into. This URL may // contain a query string and/or fragment (hash). // params - (String) A params string or URL containing fragment (hash) params @@ -199,113 +199,113 @@ // params - (Object) A params object to be merged into url. // merge_mode - (Number) Merge behavior defaults to 0 if merge_mode is not // specified, and is as-follows: - // + // // * 0: params in the params argument will override any fragment (hash) // params in url. // * 1: any fragment (hash) params in url will override params in the // params argument. // * 2: params argument will completely replace any query string in url. - // + // // Returns: - // + // // (String) Either a params string with urlencoded data or a URL with a // urlencoded fragment (hash) in the format 'a=b&c=d&e=f'. - + function jq_param_sub( is_fragment, re, url, params, merge_mode ) { var result, qs, matches, url_params, hash; - + if ( params !== undefined ) { // Build URL by merging params into url string. - + // matches[1] = url part that precedes params, not including trailing ?/# // matches[2] = params, not including leading ?/# // matches[3] = if in 'querystring' mode, hash including leading #, otherwise '' matches = url.match( is_fragment ? /^([^#]*)\#?(.*)$/ : /^([^#?]*)\??([^#]*)(#?.*)/ ); - + // Get the hash if in 'querystring' mode, and it exists. hash = matches[3] || ''; - + if ( merge_mode === 2 && is_string( params ) ) { // If merge_mode is 2 and params is a string, merge the fragment / query // string into the URL wholesale, without converting it into an object. qs = params.replace( re, '' ); - + } else { // Convert relevant params in url to object. url_params = jq_deparam( matches[2] ); - + params = is_string( params ) - + // Convert passed params string into object. ? jq_deparam[ is_fragment ? str_fragment : str_querystring ]( params ) - + // Passed params object. : params; - + qs = merge_mode === 2 ? params // passed params replace url params : merge_mode === 1 ? $.extend( {}, params, url_params ) // url params override passed params : $.extend( {}, url_params, params ); // passed params override url params - + // Convert params object to a string. qs = jq_param( qs ); } - + // Build URL from the base url, querystring and hash. In 'querystring' // mode, ? is only added if a query string exists. In 'fragment' mode, # // is always added. result = matches[1] + ( is_fragment ? '#' : qs || !matches[1] ? '?' : '' ) + qs + hash; - + } else if ( url ) { // Parse params from URL string. result = url.replace( re, '' ); - + } else { result = is_fragment - + // Parse hash from location.href, removing leading #. Firefox urldecodes // location.hash by default, which breaks everything. ? loc[ str_hash ] ? loc[ str_href ].replace( re, '' ) : '' - + // Get location.search and removing any leading ? : loc.search.replace( /^\??/, '' ); } - + return result; }; - + jq_param[ str_querystring ] = curry( jq_param_sub, 0, re_trim_querystring ); jq_param[ str_fragment ] = jq_param_fragment = curry( jq_param_sub, 1, re_trim_fragment ); - + // Section: Deparam (from string) - // + // // Method: jQuery.deparam - // + // // Deserialize a params string into an object, optionally coercing numbers, // booleans, null and undefined values; this method is the counterpart to the // internal jQuery.param method. - // + // // Usage: - // + // // > jQuery.deparam( params [, coerce ] ); - // + // // Arguments: - // + // // params - (String) A params string to be parsed. // coerce - (Boolean) If true, coerces any numbers or true, false, null, and // undefined to their actual value. Defaults to false if omitted. - // + // // Returns: - // + // // (Object) An object representing the deserialized params string. - + $.deparam = jq_deparam = function( params, coerce ) { var obj = {}, coerce_types = { 'true': !0, 'false': !1, 'null': null }; - + // Iterate over all name=value pairs. $.each( params.replace( /\+/g, ' ' ).split( '&' ), function(j,v){ var param = v.split( '=' ), @@ -313,32 +313,32 @@ val, cur = obj, i = 0, - + // If key is more complex than 'foo', like 'a[]' or 'a[b][c]', split it // into its component parts. keys = key.split( '][' ), keys_last = keys.length - 1; - + // If the first keys part contains [ and the last ends with ], then [] // are correctly balanced. if ( /\[/.test( keys[0] ) && /\]$/.test( keys[ keys_last ] ) ) { // Remove the trailing ] from the last keys part. keys[ keys_last ] = keys[ keys_last ].replace( /\]$/, '' ); - + // Split first keys part into two parts on the [ and add them back onto // the beginning of the keys array. keys = keys.shift().split('[').concat( keys ); - + keys_last = keys.length - 1; } else { // Basic 'foo' style key. keys_last = 0; } - + // Are we dealing with a name=value pair, or just a name? if ( param.length === 2 ) { val = decode( param[1] ); - + // Coerce values. if ( coerce ) { val = val && !isNaN(val) ? +val // number @@ -346,11 +346,11 @@ : coerce_types[val] !== undefined ? coerce_types[val] // true, false, null : val; // string } - + if ( keys_last ) { // Complex key, build deep object structure based on a few rules: // * The 'cur' pointer starts at the object top-level. - // * [] = array push (n is set to array length), [n] = array if n is + // * [] = array push (n is set to array length), [n] = array if n is // numeric, otherwise object. // * If at the last keys part, set the value. // * For each keys part, if the current level is undefined create an @@ -363,26 +363,26 @@ ? cur[key] || ( keys[i+1] && isNaN( keys[i+1] ) ? {} : [] ) : val; } - + } else { // Simple key, even simpler rules, since only scalars and shallow // arrays are allowed. - + if ( $.isArray( obj[key] ) ) { // val is already an array, so push on the next value. obj[key].push( val ); - + } else if ( obj[key] !== undefined ) { // val isn't an array, but since a second value has been specified, // convert val into an array. obj[key] = [ obj[key], val ]; - + } else { // val is a scalar. obj[key] = val; } } - + } else if ( key ) { // No value was defined, so set something meaningful. obj[key] = coerce @@ -390,54 +390,54 @@ : ''; } }); - + return obj; }; - + // Method: jQuery.deparam.querystring - // + // // Parse the query string from a URL or the current document.location, // deserializing it into an object, optionally coercing numbers, booleans, // null and undefined values. - // + // // Usage: - // + // // > jQuery.deparam.querystring( [ url ] [, coerce ] ); - // + // // Arguments: - // + // // url - (String) An optional params string or URL containing query string // params to be parsed. If url is omitted, the current document.location // is used. // coerce - (Boolean) If true, coerces any numbers or true, false, null, and // undefined to their actual value. Defaults to false if omitted. - // + // // Returns: - // + // // (Object) An object representing the deserialized params string. - + // Method: jQuery.deparam.fragment - // + // // Parse the fragment (hash) from a URL or the current document.location, // deserializing it into an object, optionally coercing numbers, booleans, // null and undefined values. - // + // // Usage: - // + // // > jQuery.deparam.fragment( [ url ] [, coerce ] ); - // + // // Arguments: - // + // // url - (String) An optional params string or URL containing fragment (hash) // params to be parsed. If url is omitted, the current document.location // is used. // coerce - (Boolean) If true, coerces any numbers or true, false, null, and // undefined to their actual value. Defaults to false if omitted. - // + // // Returns: - // + // // (Object) An object representing the deserialized params string. - + function jq_deparam_sub( mode, re, url_or_params, coerce ) { if ( url_or_params === undefined || typeof url_or_params === 'boolean' ) { // url_or_params not specified. @@ -448,26 +448,26 @@ ? url_or_params.replace( re, '' ) : url_or_params; } - + return jq_deparam( url_or_params, coerce ); }; - + jq_deparam[ str_querystring ] = curry( jq_deparam_sub, str_querystring, re_trim_querystring ); jq_deparam[ str_fragment ] = jq_deparam_fragment = curry( jq_deparam_sub, str_fragment, re_trim_fragment ); - + // Section: Element manipulation - // + // // Method: jQuery.elemUrlAttr - // + // // Get the internal "Default URL attribute per tag" list, or augment the list // with additional tag-attribute pairs, in case the defaults are insufficient. - // + // // In the and methods, this list // is used to determine which attribute contains the URL to be modified, if // an "attr" param is not specified. - // + // // Default Tag-Attribute List: - // + // // a - href // base - href // iframe - src @@ -476,21 +476,21 @@ // form - action // link - href // script - src - // + // // Usage: - // + // // > jQuery.elemUrlAttr( [ tag_attr ] ); - // + // // Arguments: - // + // // tag_attr - (Object) An object containing a list of tag names and their // associated default attribute names in the format { tag: 'attr', ... } to // be merged into the internal tag-attribute list. - // + // // Returns: - // + // // (Object) An object containing all stored tag-attribute values. - + // Only define function and set defaults if function doesn't already exist, as // the urlInternal plugin will provide this method as well. $[ str_elemUrlAttr ] || ($[ str_elemUrlAttr ] = function( obj ) { @@ -505,23 +505,23 @@ link: str_href, script: str_src }); - + jq_elemUrlAttr = $[ str_elemUrlAttr ]; - + // Method: jQuery.fn.querystring - // + // // Update URL attribute in one or more elements, merging the current URL (with // or without pre-existing query string params) plus any params object or // string into a new URL, which is then set into that attribute. Like // , but for all elements in a jQuery // collection. - // + // // Usage: - // + // // > jQuery('selector').querystring( [ attr, ] params [, merge_mode ] ); - // + // // Arguments: - // + // // attr - (String) Optional name of an attribute that will contain a URL to // merge params or url into. See for a list of default // attributes. @@ -530,31 +530,31 @@ // to be merged into the URL attribute. // merge_mode - (Number) Merge behavior defaults to 0 if merge_mode is not // specified, and is as-follows: - // + // // * 0: params in the params argument will override any params in attr URL. // * 1: any params in attr URL will override params in the params argument. // * 2: params argument will completely replace any query string in attr // URL. - // + // // Returns: - // + // // (jQuery) The initial jQuery collection of elements, but with modified URL // attribute values. - + // Method: jQuery.fn.fragment - // + // // Update URL attribute in one or more elements, merging the current URL (with // or without pre-existing fragment/hash params) plus any params object or // string into a new URL, which is then set into that attribute. Like // , but for all elements in a jQuery // collection. - // + // // Usage: - // + // // > jQuery('selector').fragment( [ attr, ] params [, merge_mode ] ); - // + // // Arguments: - // + // // attr - (String) Optional name of an attribute that will contain a URL to // merge params into. See for a list of default // attributes. @@ -563,17 +563,17 @@ // string to be merged into the URL attribute. // merge_mode - (Number) Merge behavior defaults to 0 if merge_mode is not // specified, and is as-follows: - // + // // * 0: params in the params argument will override any params in attr URL. // * 1: any params in attr URL will override params in the params argument. // * 2: params argument will completely replace any fragment (hash) in attr // URL. - // + // // Returns: - // + // // (jQuery) The initial jQuery collection of elements, but with modified URL // attribute values. - + function jq_fn_sub( mode, force_attr, params, merge_mode ) { if ( !is_string( params ) && typeof params !== 'object' ) { // force_attr not specified. @@ -581,138 +581,138 @@ params = force_attr; force_attr = undefined; } - + return this.each(function(){ var that = $(this), - + // Get attribute specified, or default specified via $.elemUrlAttr. attr = force_attr || jq_elemUrlAttr()[ ( this.nodeName || '' ).toLowerCase() ] || '', - + // Get URL value. url = attr && that.attr( attr ) || ''; - + // Update attribute with new URL. that.attr( attr, jq_param[ mode ]( url, params, merge_mode ) ); }); - + }; - + $.fn[ str_querystring ] = curry( jq_fn_sub, str_querystring ); $.fn[ str_fragment ] = curry( jq_fn_sub, str_fragment ); - + // Section: History, hashchange event - // + // // Method: jQuery.bbq.pushState - // + // // Adds a 'state' into the browser history at the current position, setting // location.hash and triggering any bound event // callbacks (provided the new state is different than the previous state). - // + // // If no arguments are passed, an empty state is created, which is just a // shortcut for jQuery.bbq.pushState( {}, 2 ). - // + // // Usage: - // + // // > jQuery.bbq.pushState( [ params [, merge_mode ] ] ); - // + // // Arguments: - // + // // params - (String) A serialized params string or a hash string beginning // with # to merge into location.hash. // params - (Object) A params object to merge into location.hash. // merge_mode - (Number) Merge behavior defaults to 0 if merge_mode is not // specified (unless a hash string beginning with # is specified, in which // case merge behavior defaults to 2), and is as-follows: - // + // // * 0: params in the params argument will override any params in the // current state. // * 1: any params in the current state will override params in the params // argument. // * 2: params argument will completely replace current state. - // + // // Returns: - // + // // Nothing. - // + // // Additional Notes: - // + // // * Setting an empty state may cause the browser to scroll. // * Unlike the fragment and querystring methods, if a hash string beginning // with # is specified as the params agrument, merge_mode defaults to 2. - + jq_bbq.pushState = jq_bbq_pushState = function( params, merge_mode ) { if ( is_string( params ) && /^#/.test( params ) && merge_mode === undefined ) { // Params string begins with # and merge_mode not specified, so completely // overwrite document.location.hash. merge_mode = 2; } - + var has_args = params !== undefined, // Merge params into document.location using $.param.fragment. url = jq_param_fragment( loc[ str_href ], has_args ? params : {}, has_args ? merge_mode : 2 ); - + // Set new document.location.href. If hash is empty, use just # to prevent // browser from reloading the page. Note that Safari 3 & Chrome barf on // location.hash = '#'. loc[ str_href ] = url + ( /#/.test( url ) ? '' : '#' ); }; - + // Method: jQuery.bbq.getState - // + // // Retrieves the current 'state' from the browser history, parsing // location.hash for a specific key or returning an object containing the // entire state, optionally coercing numbers, booleans, null and undefined // values. - // + // // Usage: - // + // // > jQuery.bbq.getState( [ key ] [, coerce ] ); - // + // // Arguments: - // + // // key - (String) An optional state key for which to return a value. // coerce - (Boolean) If true, coerces any numbers or true, false, null, and // undefined to their actual value. Defaults to false. - // + // // Returns: - // + // // (Anything) If key is passed, returns the value corresponding with that key // in the location.hash 'state', or undefined. If not, an object // representing the entire 'state' is returned. - + jq_bbq.getState = function( key, coerce ) { return key === undefined || typeof key === 'boolean' ? jq_deparam_fragment( key ) // 'key' really means 'coerce' here : jq_deparam_fragment( coerce )[ key ]; }; - + // Property: jQuery.bbq.pollDelay - // + // // The numeric interval (in milliseconds) at which the // polling loop executes. Defaults to 100. - + jq_bbq.pollDelay = 100; - + // Event: window.onhashchange - // + // // Fired when document.location.hash changes. In browsers that support it, the // native window.onhashchange event is used (IE8, FF3.6), otherwise a polling // loop is initialized, running every milliseconds to // see if the hash has changed. In IE 6 and 7, a hidden IFRAME is created // to allow hash-based history to work. - // + // // Usage in 1.4pre and newer: - // + // // In 1.4pre and newer, the event object that is passed into the callback is // augmented with an additional e.fragment property that contains the current // document location.hash state as a string, as well as an e.getState method. - // + // // e.fragment is equivalent to the output of , and // e.getState() is equivalent to , except that they refer // to the event-specific state value stored in the event object, instead of // the current document.location, allowing the event object to be referenced // later, even if document.location has changed. - // + // // > $(window).bind( 'hashchange', function(e) { // > var hash_str = e.fragment, // > param_obj = e.getState(), @@ -720,13 +720,13 @@ // > param_val_coerced = e.getState( 'param_name', true ); // > ... // > }); - // + // // Usage in 1.3.2: - // + // // In 1.3.2, the event object is unable to be augmented as in 1.4pre+, so the // fragment state isn't bound to the event object and must instead be parsed // using the and methods. - // + // // > $(window).bind( 'hashchange', function(e) { // > var hash_str = $.param.fragment(), // > param_obj = $.bbq.getState(), @@ -734,37 +734,37 @@ // > param_val_coerced = $.bbq.getState( 'param_name', true ); // > ... // > }); - // + // // Additional Notes: - // + // // * The polling loop and iframe are not created until at least one callback // is actually bound to 'hashchange'. // * If you need the bound callback(s) to execute immediately, in cases where // the page 'state' exists on page load (via bookmark or page refresh, for // example) use $(window).trigger( 'hashchange' ); - + $.event.special[ str_hashchange ] = { - + // Called only when the first 'hashchange' event is bound to window. setup: function() { // If window.onhashchange is supported natively, there's nothing to do.. if ( supports_onhashchange ) { return false; } - + // Otherwise, we need to create our own. And we don't want to call this // until the user binds to the event, just in case they never do, since it // will create a polling loop and possibly even a hidden IFRAME. fake_onhashchange.start(); }, - + // Called only when the last 'hashchange' event is unbound from window. teardown: function() { // If window.onhashchange is supported natively, there's nothing to do.. if ( supports_onhashchange ) { return false; } - + // Otherwise, we need to stop ours (if possible). fake_onhashchange.stop(); }, - + // Augmenting the event object with the .fragment property and .getState // method requires jQuery 1.4 or newer. Note: with 1.3.2, everything will // work, but the event won't be augmented) @@ -773,7 +773,7 @@ // e.fragment is set to the value of location.hash (with any leading # // removed) at the time the event is triggered. var hash = e[ str_fragment ] = jq_param_fragment(); - + // e.getState() works just like $.bbq.getState(), but uses the // e.fragment property stored on the event object. e.getState = function( key, coerce ) { @@ -781,12 +781,12 @@ ? jq_deparam( hash, key ) // 'key' really means 'coerce' here : jq_deparam( hash, coerce )[ key ]; }; - + handler.apply( this, arguments ); }; } }; - + // fake_onhashchange does all the work of triggering the window.onhashchange // event for browsers that don't natively support it, including creating a // polling loop to watch for hash changes and in IE 6/7 creating a hidden @@ -797,23 +797,23 @@ iframe, set_history, get_history; - + // Initialize. In IE 6/7, creates a hidden IFRAME for history handling. function init(){ // Most browsers don't need special methods here.. set_history = get_history = function(val){ return val; }; - + // But IE6/7 do! if ( is_old_ie ) { - + // Create hidden IFRAME at the end of the body. iframe = $('
memoryTotalThe total amount of memory available -to membase, allocated and free. May or may not be equal to the amount +to membase, allocated and free. May or may not be equal to the amount of memory configured in the system.
memoryFreeThe amount of memory available to be allocated. This is equal to the memoryTotal, subtracting out all @@ -448,12 +448,12 @@ by all buckets on this node.