remove trailing whitespaces ❤️

This commit is contained in:
Gosha Arinich 2013-02-25 19:42:20 +03:00
parent b50e0536c7
commit cafc75b238
383 changed files with 4220 additions and 2221 deletions

View file

@ -24,7 +24,7 @@ If you're familiar with how Rails works and are comfortable setting up your own
## Vision ## Vision
Discourse is a **Civilized Discourse Construction Kit**, an 100% open-source discussion platform that is free for everyone to use and contribute to -- forever. Discourse is a **Civilized Discourse Construction Kit**, an 100% open-source discussion platform that is free for everyone to use and contribute to -- forever.
Key Discourse mission goals: Key Discourse mission goals:
@ -44,7 +44,7 @@ This vision translates to the following functional commitments:
- Internet Explorer 9.0, 10.0+ - Internet Explorer 9.0, 10.0+
- Firefox 16+ - Firefox 16+
- Google Chrome 23+ - Google Chrome 23+
- Safari 5+ - Safari 5+
2. Support the latest generation of tablets, 7" or larger 2. Support the latest generation of tablets, 7" or larger
- iPad 2+ - iPad 2+
- Android 4.1+ - Android 4.1+

View file

@ -9,7 +9,6 @@
Discourse.EmailLog = Discourse.Model.extend({}); Discourse.EmailLog = Discourse.Model.extend({});
Discourse.EmailLog.reopenClass({ Discourse.EmailLog.reopenClass({
create: function(attrs) { create: function(attrs) {
if (attrs.user) { if (attrs.user) {
attrs.user = Discourse.AdminUser.create(attrs.user); attrs.user = Discourse.AdminUser.create(attrs.user);

View file

@ -15,5 +15,3 @@ Discourse.AdminCustomizeRoute = Discourse.Route.extend({
this.render({into: 'admin/templates/admin'}); this.render({into: 'admin/templates/admin'});
} }
}); });

View file

@ -15,5 +15,3 @@ Discourse.AdminEmailLogsRoute = Discourse.Route.extend({
this.render('admin/templates/email_logs'); this.render('admin/templates/email_logs');
} }
}); });

View file

@ -11,5 +11,3 @@ Discourse.AdminFlagsRoute = Discourse.Route.extend({
this.render('admin/templates/flags'); this.render('admin/templates/flags');
} }
}); });

View file

@ -11,5 +11,3 @@ Discourse.AdminRoute = Discourse.Route.extend({
this.render('admin/templates/admin'); this.render('admin/templates/admin');
} }
}); });

View file

@ -6,7 +6,6 @@
**/ **/
Discourse.buildRoutes(function() { Discourse.buildRoutes(function() {
this.resource('admin', { path: '/admin' }, function() { this.resource('admin', { path: '/admin' }, function() {
this.route('dashboard', { path: '/' }); this.route('dashboard', { path: '/' });
this.route('site_settings', { path: '/site_settings' }); this.route('site_settings', { path: '/site_settings' });
this.route('email_logs', { path: '/email_logs' }); this.route('email_logs', { path: '/email_logs' });

View file

@ -15,5 +15,3 @@ Discourse.AdminSiteSettingsRoute = Discourse.Route.extend({
this.render('admin/templates/site_settings', {into: 'admin/templates/admin'}); this.render('admin/templates/site_settings', {into: 'admin/templates/admin'});
} }
}); });

View file

@ -14,7 +14,4 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
renderTemplate: function() { renderTemplate: function() {
this.render('admin/templates/user', {into: 'admin/templates/admin'}); this.render('admin/templates/user', {into: 'admin/templates/admin'});
} }
}); });

View file

@ -11,5 +11,3 @@ Discourse.AdminUsersListActiveRoute = Discourse.Route.extend({
return this.controllerFor('adminUsersList').show('active'); return this.controllerFor('adminUsersList').show('active');
} }
}); });

View file

@ -11,5 +11,3 @@ Discourse.AdminUsersListNewRoute = Discourse.Route.extend({
return this.controllerFor('adminUsersList').show('new'); return this.controllerFor('adminUsersList').show('new');
} }
}); });

View file

@ -11,5 +11,3 @@ Discourse.AdminUsersListPendingRoute = Discourse.Route.extend({
return this.controllerFor('adminUsersList').show('pending'); return this.controllerFor('adminUsersList').show('pending');
} }
}); });

View file

@ -11,5 +11,3 @@ Discourse.AdminUsersListRoute = Discourse.Route.extend({
this.render('admin/templates/users_list', {into: 'admin/templates/admin'}); this.render('admin/templates/users_list', {into: 'admin/templates/admin'});
} }
}); });

View file

@ -1,7 +1,7 @@
//= depend_on 'client.en.yml' //= depend_on 'client.en.yml'
<% SimplesIdeias::I18n.assert_usable_configuration! %> <% SimplesIdeias::I18n.assert_usable_configuration! %>
<% admin = SimplesIdeias::I18n.translation_segments['app/assets/javascripts/i18n/admin.en.js'] <% admin = SimplesIdeias::I18n.translation_segments['app/assets/javascripts/i18n/admin.en.js']
admin[:en][:js] = admin[:en].delete(:admin_js) admin[:en][:js] = admin[:en].delete(:admin_js)
%> %>
jQuery.extend(true, I18n.translations, <%= admin.to_json %>); jQuery.extend(true, I18n.translations, <%= admin.to_json %>);

View file

@ -46,5 +46,3 @@ Discourse.AdminCustomizeView = Discourse.View.extend({
} }
}); });

View file

@ -49,5 +49,5 @@
# Include javascripts # Include javascripts
DiscoursePluginRegistry.javascripts.each do |js| DiscoursePluginRegistry.javascripts.each do |js|
require_asset(js) require_asset(js)
end end
%> %>

View file

@ -414,7 +414,7 @@ URI.prototype.setPath = function (newPath) {
URI.prototype.setRawPath = function (newPath) { URI.prototype.setRawPath = function (newPath) {
if (newPath) { if (newPath) {
newPath = String(newPath); newPath = String(newPath);
this.path_ = this.path_ =
// Paths must start with '/' unless this is a path-relative URL. // Paths must start with '/' unless this is a path-relative URL.
(!this.domain_ || /^\//.test(newPath)) ? newPath : '/' + newPath; (!this.domain_ || /^\//.test(newPath)) ? newPath : '/' + newPath;
} else { } else {

View file

@ -190,4 +190,4 @@ Discourse.BBCode = {
text = Discourse.BBCode.formatQuote(text, opts); text = Discourse.BBCode.formatQuote(text, opts);
return text; return text;
} }
}; };

View file

@ -31,7 +31,7 @@ Discourse.debounce = function(func, wait, trickle) {
} else { } else {
currentWait = wait; currentWait = wait;
} }
if (timeout) { if (timeout) {
clearTimeout(timeout); clearTimeout(timeout);
} }

View file

@ -1,10 +1,9 @@
/* /*
* JavaScript probing framework by Sam Saffron * JavaScript probing framework by Sam Saffron
* MIT license * MIT license
* *
* *
* Examples: * Examples:
*
* *
* someFunction = window.probes.measure(someFunction, { * someFunction = window.probes.measure(someFunction, {
* name: "somename" // or function(args) { return "name"; }, * name: "somename" // or function(args) { return "name"; },
@ -26,10 +25,9 @@
* // minimal * // minimal
* someFunction = window.probes.measure(someFunction, "someFunction"); * someFunction = window.probes.measure(someFunction, "someFunction");
* *
*
* */ * */
(function(){ (function(){
var measure, clear; var measure, clear;
clear = function() { clear = function() {
window.probes = { window.probes = {
@ -48,14 +46,14 @@
if (typeof options === "string") { if (typeof options === "string") {
nameParam = options; nameParam = options;
} }
else else
{ {
nameParam = options.name; nameParam = options.name;
if (nameParam === "measure" || nameParam === "clear") { if (nameParam === "measure" || nameParam === "clear") {
throw new Error("can not be called measure or clear"); throw new Error("can not be called measure or clear");
} }
if (!nameParam) if (!nameParam)
{ {
throw new Error("you must specify the name option measure(fn, {name: 'some name'})"); throw new Error("you must specify the name option measure(fn, {name: 'some name'})");
@ -78,7 +76,7 @@
} }
var p = window.probes[name]; var p = window.probes[name];
var owner = (!start); var owner = (!start);
if (before) { if (before) {
// would like to avoid try catch so its optimised properly by chrome // would like to avoid try catch so its optimised properly by chrome
before(p, owner, arguments); before(p, owner, arguments);
@ -94,14 +92,14 @@
start = now(); start = now();
callStart = start; callStart = start;
} }
else if(after) else if(after)
{ {
callStart = now(); callStart = now();
} }
var r = fn.apply(this, arguments); var r = fn.apply(this, arguments);
if (owner && start) { if (owner && start) {
p.time += now() - start; p.time += now() - start;
start = null; start = null;
} }
p.count += 1; p.count += 1;

View file

@ -155,5 +155,3 @@ Discourse.ScreenTrack = Ember.Object.extend({
} }
}); });

View file

@ -15,5 +15,3 @@ Discourse.UserRoute = Discourse.Route.extend({
return { username: Em.get(params, 'username').toLowerCase() }; return { username: Em.get(params, 'username').toLowerCase() };
} }
}); });

View file

@ -1,5 +1,5 @@
//= depend_on 'client.en.yml' //= depend_on 'client.en.yml'
<% SimplesIdeias::I18n.assert_usable_configuration! %> <% SimplesIdeias::I18n.assert_usable_configuration! %>
var I18n = I18n || {}; var I18n = I18n || {};
I18n.translations = <%= SimplesIdeias::I18n.translation_segments['app/assets/javascripts/i18n/en.js'].to_json %>; I18n.translations = <%= SimplesIdeias::I18n.translation_segments['app/assets/javascripts/i18n/en.js'].to_json %>;

View file

@ -28,5 +28,3 @@ Discourse.ArchetypeOptionsView = Em.ContainerView.extend({
} }
}); });

View file

@ -162,5 +162,3 @@ Discourse.PostMenuView = Discourse.View.extend({
} }
}); });

View file

@ -8,5 +8,3 @@
@module Discourse @module Discourse
**/ **/
window.Discourse.View = Ember.View.extend(Discourse.Presence, {}); window.Discourse.View = Ember.View.extend(Discourse.Presence, {});

View file

@ -4,7 +4,7 @@ if (typeof exports === "object" && typeof require === "function") // we're in a
Markdown = exports; Markdown = exports;
else else
Markdown = {}; Markdown = {};
// The following text is included for historical reasons, but should // The following text is included for historical reasons, but should
// be taken with a pinch of salt; it's not all true anymore. // be taken with a pinch of salt; it's not all true anymore.
@ -107,26 +107,26 @@ else
Markdown.Converter = function () { Markdown.Converter = function () {
var pluginHooks = this.hooks = new HookCollection(); var pluginHooks = this.hooks = new HookCollection();
// given a URL that was encountered by itself (without markup), should return the link text that's to be given to this link // given a URL that was encountered by itself (without markup), should return the link text that's to be given to this link
pluginHooks.addNoop("plainLinkText"); pluginHooks.addNoop("plainLinkText");
// called with the orignal text as given to makeHtml. The result of this plugin hook is the actual markdown source that will be cooked // called with the orignal text as given to makeHtml. The result of this plugin hook is the actual markdown source that will be cooked
pluginHooks.addNoop("preConversion"); pluginHooks.addNoop("preConversion");
// called with the text once all normalizations have been completed (tabs to spaces, line endings, etc.), but before any conversions have // called with the text once all normalizations have been completed (tabs to spaces, line endings, etc.), but before any conversions have
pluginHooks.addNoop("postNormalization"); pluginHooks.addNoop("postNormalization");
// Called with the text before / after creating block elements like code blocks and lists. Note that this is called recursively // Called with the text before / after creating block elements like code blocks and lists. Note that this is called recursively
// with inner content, e.g. it's called with the full text, and then only with the content of a blockquote. The inner // with inner content, e.g. it's called with the full text, and then only with the content of a blockquote. The inner
// call will receive outdented text. // call will receive outdented text.
pluginHooks.addNoop("preBlockGamut"); pluginHooks.addNoop("preBlockGamut");
pluginHooks.addNoop("postBlockGamut"); pluginHooks.addNoop("postBlockGamut");
// called with the text of a single block element before / after the span-level conversions (bold, code spans, etc.) have been made // called with the text of a single block element before / after the span-level conversions (bold, code spans, etc.) have been made
pluginHooks.addNoop("preSpanGamut"); pluginHooks.addNoop("preSpanGamut");
pluginHooks.addNoop("postSpanGamut"); pluginHooks.addNoop("postSpanGamut");
// called with the final cooked HTML code. The result of this plugin hook is the actual output of makeHtml // called with the final cooked HTML code. The result of this plugin hook is the actual output of makeHtml
pluginHooks.addNoop("postConversion"); pluginHooks.addNoop("postConversion");
@ -156,7 +156,7 @@ else
// Don't do that. // Don't do that.
if (g_urls) if (g_urls)
throw new Error("Recursive call to converter.makeHtml"); throw new Error("Recursive call to converter.makeHtml");
// Create the private state objects. // Create the private state objects.
g_urls = new SaveHash(); g_urls = new SaveHash();
g_titles = new SaveHash(); g_titles = new SaveHash();
@ -191,7 +191,7 @@ else
// match consecutive blank lines with /\n+/ instead of something // match consecutive blank lines with /\n+/ instead of something
// contorted like /[ \t]*\n+/ . // contorted like /[ \t]*\n+/ .
text = text.replace(/^[ \t]+$/mg, ""); text = text.replace(/^[ \t]+$/mg, "");
text = pluginHooks.postNormalization(text); text = pluginHooks.postNormalization(text);
// Turn block-level HTML blocks into hash entries // Turn block-level HTML blocks into hash entries
@ -330,7 +330,7 @@ else
text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement); text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement);
// Special case just for <hr />. It was easier to make a special case than // Special case just for <hr />. It was easier to make a special case than
// to make the other regex more complicated. // to make the other regex more complicated.
/* /*
text = text.replace(/ text = text.replace(/
@ -403,7 +403,7 @@ else
return blockText; return blockText;
} }
var blockGamutHookCallback = function (t) { return _RunBlockGamut(t); } var blockGamutHookCallback = function (t) { return _RunBlockGamut(t); }
function _RunBlockGamut(text, doNotUnhash) { function _RunBlockGamut(text, doNotUnhash) {
@ -411,9 +411,9 @@ else
// These are all the transformations that form block-level // These are all the transformations that form block-level
// tags like paragraphs, headers, and list items. // tags like paragraphs, headers, and list items.
// //
text = pluginHooks.preBlockGamut(text, blockGamutHookCallback); text = pluginHooks.preBlockGamut(text, blockGamutHookCallback);
text = _DoHeaders(text); text = _DoHeaders(text);
// Do Horizontal Rules: // Do Horizontal Rules:
@ -425,7 +425,7 @@ else
text = _DoLists(text); text = _DoLists(text);
text = _DoCodeBlocks(text); text = _DoCodeBlocks(text);
text = _DoBlockQuotes(text); text = _DoBlockQuotes(text);
text = pluginHooks.postBlockGamut(text, blockGamutHookCallback); text = pluginHooks.postBlockGamut(text, blockGamutHookCallback);
// We already ran _HashHTMLBlocks() before, in Markdown(), but that // We already ran _HashHTMLBlocks() before, in Markdown(), but that
@ -445,7 +445,7 @@ else
// //
text = pluginHooks.preSpanGamut(text); text = pluginHooks.preSpanGamut(text);
text = _DoCodeSpans(text); text = _DoCodeSpans(text);
text = _EscapeSpecialCharsWithinTagAttributes(text); text = _EscapeSpecialCharsWithinTagAttributes(text);
text = _EncodeBackslashEscapes(text); text = _EncodeBackslashEscapes(text);
@ -459,15 +459,15 @@ else
// Must come after _DoAnchors(), because you can use < and > // Must come after _DoAnchors(), because you can use < and >
// delimiters in inline links like [this](<url>). // delimiters in inline links like [this](<url>).
text = _DoAutoLinks(text); text = _DoAutoLinks(text);
text = text.replace(/~P/g, "://"); // put in place to prevent autolinking; reset now text = text.replace(/~P/g, "://"); // put in place to prevent autolinking; reset now
text = _EncodeAmpsAndAngles(text); text = _EncodeAmpsAndAngles(text);
text = _DoItalicsAndBold(text); text = _DoItalicsAndBold(text);
// Do hard breaks: // Do hard breaks:
text = text.replace(/ +\n/g, " <br>\n"); text = text.replace(/ +\n/g, " <br>\n");
text = pluginHooks.postSpanGamut(text); text = pluginHooks.postSpanGamut(text);
return text; return text;
@ -479,7 +479,7 @@ else
// don't conflict with their use in Markdown for code, italics and strong. // don't conflict with their use in Markdown for code, italics and strong.
// //
// Build a regex to find HTML tags and comments. See Friedl's // Build a regex to find HTML tags and comments. See Friedl's
// "Mastering Regular Expressions", 2nd Ed., pp. 200-201. // "Mastering Regular Expressions", 2nd Ed., pp. 200-201.
// SE: changed the comment part of the regex // SE: changed the comment part of the regex
@ -553,7 +553,7 @@ else
| |
[^()\s] [^()\s]
)*? )*?
)>? )>?
[ \t]* [ \t]*
( // $5 ( // $5
(['"]) // quote char = $6 (['"]) // quote char = $6
@ -692,7 +692,7 @@ else
return text; return text;
} }
function attributeEncode(text) { function attributeEncode(text) {
// unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title) // unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title)
// never makes sense to have verbatim HTML in it (and the sanitizer would totally break it) // never makes sense to have verbatim HTML in it (and the sanitizer would totally break it)
@ -725,7 +725,7 @@ else
return whole_match; return whole_match;
} }
} }
alt_text = escapeCharacters(attributeEncode(alt_text), "*_[]()"); alt_text = escapeCharacters(attributeEncode(alt_text), "*_[]()");
url = escapeCharacters(url, "*_"); url = escapeCharacters(url, "*_");
var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\""; var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\"";
@ -749,7 +749,7 @@ else
// Setext-style headers: // Setext-style headers:
// Header 1 // Header 1
// ======== // ========
// //
// Header 2 // Header 2
// -------- // --------
// //
@ -908,7 +908,7 @@ else
// //
// We changed this to behave identical to MarkdownSharp. This is the constructed RegEx, // We changed this to behave identical to MarkdownSharp. This is the constructed RegEx,
// with {MARKER} being one of \d+[.] or [*+-], depending on list_type: // with {MARKER} being one of \d+[.] or [*+-], depending on list_type:
/* /*
list_str = list_str.replace(/ list_str = list_str.replace(/
(^[ \t]*) // leading whitespace = $1 (^[ \t]*) // leading whitespace = $1
@ -956,7 +956,7 @@ else
function _DoCodeBlocks(text) { function _DoCodeBlocks(text) {
// //
// Process Markdown `<pre><code>` blocks. // Process Markdown `<pre><code>` blocks.
// //
/* /*
text = text.replace(/ text = text.replace(/
@ -1004,26 +1004,26 @@ else
function _DoCodeSpans(text) { function _DoCodeSpans(text) {
// //
// * Backtick quotes are used for <code></code> spans. // * Backtick quotes are used for <code></code> spans.
// //
// * You can use multiple backticks as the delimiters if you want to // * You can use multiple backticks as the delimiters if you want to
// include literal backticks in the code span. So, this input: // include literal backticks in the code span. So, this input:
// //
// Just type ``foo `bar` baz`` at the prompt. // Just type ``foo `bar` baz`` at the prompt.
// //
// Will translate to: // Will translate to:
// //
// <p>Just type <code>foo `bar` baz</code> at the prompt.</p> // <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
// //
// There's no arbitrary limit to the number of backticks you // There's no arbitrary limit to the number of backticks you
// can use as delimters. If you need three consecutive backticks // can use as delimters. If you need three consecutive backticks
// in your code, use four for delimiters, etc. // in your code, use four for delimiters, etc.
// //
// * You can use spaces to get literal backticks at the edges: // * You can use spaces to get literal backticks at the edges:
// //
// ... type `` `bar` `` ... // ... type `` `bar` `` ...
// //
// Turns to: // Turns to:
// //
// ... type <code>`bar`</code> ... // ... type <code>`bar`</code> ...
// //
@ -1156,7 +1156,7 @@ else
var grafs = text.split(/\n{2,}/g); var grafs = text.split(/\n{2,}/g);
var grafsOut = []; var grafsOut = [];
var markerRe = /~K(\d+)K/; var markerRe = /~K(\d+)K/;
// //
@ -1230,7 +1230,7 @@ else
text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, escapeCharacters_callback); text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, escapeCharacters_callback);
return text; return text;
} }
function handleTrailingParens(wholeMatch, lookbehind, protocol, link) { function handleTrailingParens(wholeMatch, lookbehind, protocol, link) {
if (lookbehind) if (lookbehind)
return wholeMatch; return wholeMatch;
@ -1257,7 +1257,7 @@ else
return ""; return "";
}); });
} }
return "<" + protocol + link + ">" + tail; return "<" + protocol + link + ">" + tail;
} }
@ -1273,13 +1273,13 @@ else
text = text.replace(/(="|='|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens); text = text.replace(/(="|='|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens);
// autolink anything like <http://example.com> // autolink anything like <http://example.com>
var replacer = function (wholematch, m1) { var replacer = function (wholematch, m1) {
m1encoded = m1.replace(/\_\_/, '%5F%5F'); m1encoded = m1.replace(/\_\_/, '%5F%5F');
return "<a href=\"" + m1encoded + "\">" + pluginHooks.plainLinkText(m1) + "</a>"; return "<a href=\"" + m1encoded + "\">" + pluginHooks.plainLinkText(m1) + "</a>";
} }
text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer); text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer);
return text; return text;
} }
@ -1337,7 +1337,7 @@ else
var _problemUrlChars = /(?:["'*()[\]:]|~D)/g; var _problemUrlChars = /(?:["'*()[\]:]|~D)/g;
// hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems // hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems
function encodeProblemUrlChars(url) { function encodeProblemUrlChars(url) {
if (!url) if (!url)
return ""; return "";

View file

@ -77,7 +77,7 @@
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// YOUR CHANGES GO HERE // YOUR CHANGES GO HERE
// //
// I've tried to localize the things you are likely to change to // I've tried to localize the things you are likely to change to
// this area. // this area.
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -109,7 +109,7 @@
// - run() actually starts the editor; should be called after all necessary plugins are registered. Calling this more than once is a no-op. // - run() actually starts the editor; should be called after all necessary plugins are registered. Calling this more than once is a no-op.
// - refreshPreview() forces the preview to be updated. This method is only available after run() was called. // - refreshPreview() forces the preview to be updated. This method is only available after run() was called.
Markdown.Editor = function (markdownConverter, idPostfix, options) { Markdown.Editor = function (markdownConverter, idPostfix, options) {
options = options || {}; options = options || {};
if (typeof options.handler === "function") { //backwards compatible behavior if (typeof options.handler === "function") { //backwards compatible behavior
@ -230,7 +230,7 @@
beforeReplacer = function (s) { that.before += s; return ""; } beforeReplacer = function (s) { that.before += s; return ""; }
afterReplacer = function (s) { that.after = s + that.after; return ""; } afterReplacer = function (s) { that.after = s + that.after; return ""; }
} }
this.selection = this.selection.replace(/^(\s*)/, beforeReplacer).replace(/(\s*)$/, afterReplacer); this.selection = this.selection.replace(/^(\s*)/, beforeReplacer).replace(/(\s*)$/, afterReplacer);
}; };
@ -298,14 +298,14 @@
} }
}; };
// end of Chunks // end of Chunks
// A collection of the important regions on the page. // A collection of the important regions on the page.
// Cached so we don't have to keep traversing the DOM. // Cached so we don't have to keep traversing the DOM.
// Also holds ieCachedRange and ieCachedScrollTop, where necessary; working around // Also holds ieCachedRange and ieCachedScrollTop, where necessary; working around
// this issue: // this issue:
// Internet explorer has problems with CSS sprite buttons that use HTML // Internet explorer has problems with CSS sprite buttons that use HTML
// lists. When you click on the background image "button", IE will // lists. When you click on the background image "button", IE will
// select the non-existent link text and discard the selection in the // select the non-existent link text and discard the selection in the
// textarea. The solution to this is to cache the textarea selection // textarea. The solution to this is to cache the textarea selection
// on the button's mousedown event and set a flag. In the part of the // on the button's mousedown event and set a flag. In the part of the
@ -652,7 +652,7 @@
setMode("escape"); setMode("escape");
} }
else if ((keyCode < 16 || keyCode > 20) && keyCode != 91) { else if ((keyCode < 16 || keyCode > 20) && keyCode != 91) {
// 16-20 are shift, etc. // 16-20 are shift, etc.
// 91: left window key // 91: left window key
// I think this might be a little messed up since there are // I think this might be a little messed up since there are
// a lot of nonprinting keys above 20. // a lot of nonprinting keys above 20.
@ -796,7 +796,7 @@
if (panels.ieCachedRange) if (panels.ieCachedRange)
stateObj.scrollTop = panels.ieCachedScrollTop; // this is set alongside with ieCachedRange stateObj.scrollTop = panels.ieCachedScrollTop; // this is set alongside with ieCachedRange
panels.ieCachedRange = null; panels.ieCachedRange = null;
this.setInputAreaSelection(); this.setInputAreaSelection();
@ -907,7 +907,7 @@
pushPreviewHtml(text); pushPreviewHtml(text);
}; };
// makePreviewHtml = window.probes.measure(makePreviewHtml, { // makePreviewHtml = window.probes.measure(makePreviewHtml, {
// before: function(){ window.probes.clear(); }, // before: function(){ window.probes.clear(); },
// name: "makePreview", // name: "makePreview",
@ -915,7 +915,7 @@
// }); // });
// TODO allow us to inject this in (its our debouncer) // TODO allow us to inject this in (its our debouncer)
var debounce = function(func,wait,trickle) { var debounce = function(func,wait,trickle) {
var timeout = null; var timeout = null;
return function(){ return function(){
@ -926,26 +926,26 @@
timeout = null; timeout = null;
func.apply(context, args); func.apply(context, args);
}; };
if (timeout!=null && trickle) { if (timeout!=null && trickle) {
return; return;
} }
var currentWait; var currentWait;
if (typeof wait == "function") { if (typeof wait == "function") {
currentWait = wait(); currentWait = wait();
} else { } else {
currentWait = wait; currentWait = wait;
} }
//console.log(currentWait); //console.log(currentWait);
if (timeout) { clearTimeout(timeout); } if (timeout) { clearTimeout(timeout); }
timeout = setTimeout(later, currentWait); timeout = setTimeout(later, currentWait);
} }
} }
makePreviewHtml = debounce(makePreviewHtml, function(){ makePreviewHtml = debounce(makePreviewHtml, function(){
return Math.min(Math.max((elapsedTime || 1) * 10, 80),1000); return Math.min(Math.max((elapsedTime || 1) * 10, 80),1000);
}, true); }, true);
@ -1086,9 +1086,9 @@
var background = doc.createElement("div"), var background = doc.createElement("div"),
style = background.style; style = background.style;
background.className = "wmd-prompt-background"; background.className = "wmd-prompt-background";
style.position = "absolute"; style.position = "absolute";
style.top = "0"; style.top = "0";
@ -1400,7 +1400,7 @@
// //
// var link = CreateLinkDialog(); // var link = CreateLinkDialog();
// makeMarkdownLink(link); // makeMarkdownLink(link);
// //
// Instead of this straightforward method of handling a // Instead of this straightforward method of handling a
// dialog I have to pass any code which would execute // dialog I have to pass any code which would execute
// after the dialog is dismissed (e.g. link creation) // after the dialog is dismissed (e.g. link creation)
@ -1511,7 +1511,7 @@
var b = insertButtons[i]; var b = insertButtons[i];
makeButton(b.id, b.description, b.execute) makeButton(b.id, b.description, b.execute)
} }
} }
} }
buttons.bold = makeButton("wmd-bold-button", getString("bold"), bindCommand("doBold")); buttons.bold = makeButton("wmd-bold-button", getString("bold"), bindCommand("doBold"));
@ -1767,7 +1767,7 @@
} }
else { else {
// We're moving start and end tag back into the selection, since (as we're in the else block) we're not // We're moving start and end tag back into the selection, since (as we're in the else block) we're not
// *removing* a link, but *adding* one, so whatever findTags() found is now back to being part of the // *removing* a link, but *adding* one, so whatever findTags() found is now back to being part of the
// link text. linkEnteredCallback takes care of escaping any brackets. // link text. linkEnteredCallback takes care of escaping any brackets.
@ -1805,7 +1805,7 @@
// would mean a zero-width match at the start. Since zero-width matches advance the string position, // would mean a zero-width match at the start. Since zero-width matches advance the string position,
// the first bracket could then not act as the "not a backslash" for the second. // the first bracket could then not act as the "not a backslash" for the second.
chunk.selection = (" " + chunk.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1); chunk.selection = (" " + chunk.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1);
var linkDef = " [999]: " + properlyEncoded(link); var linkDef = " [999]: " + properlyEncoded(link);
var num = that.addLinkDef(chunk, linkDef); var num = that.addLinkDef(chunk, linkDef);
@ -1847,7 +1847,7 @@
chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/, "\n\n"); chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/, "\n\n");
chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/, "\n\n"); chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/, "\n\n");
chunk.before = chunk.before.replace(/(\n|^)[ \t]+\n$/, "\n\n"); chunk.before = chunk.before.replace(/(\n|^)[ \t]+\n$/, "\n\n");
// There's no selection, end the cursor wasn't at the end of the line: // There's no selection, end the cursor wasn't at the end of the line:
// The user wants to split the current list item / code line / blockquote line // The user wants to split the current list item / code line / blockquote line
// (for the latter it doesn't really matter) in two. Temporarily select the // (for the latter it doesn't really matter) in two. Temporarily select the
@ -1875,7 +1875,7 @@
commandMgr.doCode(chunk); commandMgr.doCode(chunk);
} }
} }
if (fakeSelection) { if (fakeSelection) {
chunk.after = chunk.selection + chunk.after; chunk.after = chunk.selection + chunk.after;
chunk.selection = ""; chunk.selection = "";

View file

@ -7,7 +7,7 @@
output = window.Markdown; output = window.Markdown;
Converter = output.Converter; Converter = output.Converter;
} }
output.getSanitizingConverter = function () { output.getSanitizingConverter = function () {
var converter = new Converter(); var converter = new Converter();
converter.hooks.chain("postConversion", sanitizeHtml); converter.hooks.chain("postConversion", sanitizeHtml);
@ -37,9 +37,9 @@
/// <summary> /// <summary>
/// attempt to balance HTML tags in the html string /// attempt to balance HTML tags in the html string
/// by removing any unmatched opening or closing tags /// by removing any unmatched opening or closing tags
/// IMPORTANT: we *assume* HTML has *already* been /// IMPORTANT: we *assume* HTML has *already* been
/// sanitized and is safe/sane before balancing! /// sanitized and is safe/sane before balancing!
/// ///
/// adapted from CODESNIPPET: A8591DBA-D1D3-11DE-947C-BA5556D89593 /// adapted from CODESNIPPET: A8591DBA-D1D3-11DE-947C-BA5556D89593
/// </summary> /// </summary>
function balanceTags(html) { function balanceTags(html) {

View file

@ -48,7 +48,7 @@
$el.addClass(d).attr(d, d) : $el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d) $el.removeClass(d).removeAttr(d)
}, 0) }, 0)
} }
Button.prototype.toggle = function () { Button.prototype.toggle = function () {
var $parent = this.$element.parent('[data-toggle="buttons-radio"]') var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
@ -93,4 +93,4 @@
}) })
}) })
}(window.jQuery); }(window.jQuery);

View file

@ -1,6 +1,6 @@
// Chosen, a Select Box Enhancer for jQuery and Protoype // Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com // by Patrick Filler for Harvest, http://getharvest.com
// //
// Version 0.9.8 // Version 0.9.8
// Full source at https://github.com/harvesthq/chosen // Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com // Copyright (c) 2011 Harvest http://getharvest.com

View file

@ -1752,7 +1752,7 @@ var MapWithDefault = Ember.MapWithDefault = function(options) {
@static @static
@param [options] @param [options]
@param {anything} [options.defaultValue] @param {anything} [options.defaultValue]
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
`Ember.MapWithDefault` otherwise returns `Ember.Map` `Ember.MapWithDefault` otherwise returns `Ember.Map`
*/ */
MapWithDefault.create = function(options) { MapWithDefault.create = function(options) {
@ -1826,7 +1826,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
If you plan to run on IE8 and older browsers then you should use this If you plan to run on IE8 and older browsers then you should use this
method anytime you want to retrieve a property on an object that you don't method anytime you want to retrieve a property on an object that you don't
know for sure is private. (Properties beginning with an underscore '_' know for sure is private. (Properties beginning with an underscore '_'
are considered private.) are considered private.)
On all newer browsers, you only need to use this method to retrieve On all newer browsers, you only need to use this method to retrieve
@ -1888,7 +1888,7 @@ get = function get(obj, keyName) {
If you plan to run on IE8 and older browsers then you should use this If you plan to run on IE8 and older browsers then you should use this
method anytime you want to set a property on an object that you don't method anytime you want to set a property on an object that you don't
know for sure is private. (Properties beginning with an underscore '_' know for sure is private. (Properties beginning with an underscore '_'
are considered private.) are considered private.)
On all newer browsers, you only need to use this method to set On all newer browsers, you only need to use this method to set
@ -4229,7 +4229,7 @@ Ember.RunLoop = RunLoop;
```javascript ```javascript
Ember.run(function(){ Ember.run(function(){
// code to be execute within a RunLoop // code to be execute within a RunLoop
}); });
``` ```
@ -4268,7 +4268,7 @@ var run = Ember.run;
```javascript ```javascript
Ember.run.begin(); Ember.run.begin();
// code to be execute within a RunLoop // code to be execute within a RunLoop
Ember.run.end(); Ember.run.end();
``` ```
@ -4286,7 +4286,7 @@ Ember.run.begin = function() {
```javascript ```javascript
Ember.run.begin(); Ember.run.begin();
// code to be execute within a RunLoop // code to be execute within a RunLoop
Ember.run.end(); Ember.run.end();
``` ```
@ -7358,7 +7358,7 @@ Ember.Enumerable = Ember.Mixin.create(
@method nextObject @method nextObject
@param {Number} index the current index of the iteration @param {Number} index the current index of the iteration
@param {Object} previousObject the value returned by the last call to @param {Object} previousObject the value returned by the last call to
`nextObject`. `nextObject`.
@param {Object} context a context object you can use to maintain state. @param {Object} context a context object you can use to maintain state.
@return {Object} the next object in the iteration or undefined @return {Object} the next object in the iteration or undefined
@ -8425,9 +8425,9 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
@method arrayContentWillChange @method arrayContentWillChange
@param {Number} startIdx The starting index in the array that will change. @param {Number} startIdx The starting index in the array that will change.
@param {Number} removeAmt The number of items that will be removed. If you @param {Number} removeAmt The number of items that will be removed. If you
pass `null` assumes 0 pass `null` assumes 0
@param {Number} addAmt The number of items that will be added If you @param {Number} addAmt The number of items that will be added If you
pass `null` assumes 0. pass `null` assumes 0.
@return {Ember.Array} receiver @return {Ember.Array} receiver
*/ */
@ -8901,11 +8901,11 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
passed array. You should also call `this.enumerableContentDidChange()` passed array. You should also call `this.enumerableContentDidChange()`
@method replace @method replace
@param {Number} idx Starting index in the array to replace. If @param {Number} idx Starting index in the array to replace. If
idx >= length, then append to the end of the array. idx >= length, then append to the end of the array.
@param {Number} amt Number of elements that should be removed from @param {Number} amt Number of elements that should be removed from
the array, starting at *idx*. the array, starting at *idx*.
@param {Array} objects An array of zero or more objects that should be @param {Array} objects An array of zero or more objects that should be
inserted into the array at *idx* inserted into the array at *idx*
*/ */
replace: Ember.required(), replace: Ember.required(),
@ -10160,14 +10160,14 @@ CoreObject.PrototypeMixin = Mixin.create({
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz'] view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
``` ```
Adding a single property that is not an array will just add it in the array: Adding a single property that is not an array will just add it in the array:
```javascript ```javascript
var view = App.FooBarView.create({ var view = App.FooBarView.create({
classNames: 'baz' classNames: 'baz'
}) })
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz'] view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
``` ```
Using the `concatenatedProperties` property, we can tell to Ember that mix Using the `concatenatedProperties` property, we can tell to Ember that mix
the content of the properties. the content of the properties.
@ -14250,7 +14250,7 @@ class:
* `mouseEnter` * `mouseEnter`
* `mouseLeave` * `mouseLeave`
Form events: Form events:
* `submit` * `submit`
* `change` * `change`
@ -14258,7 +14258,7 @@ class:
* `focusOut` * `focusOut`
* `input` * `input`
HTML5 drag and drop events: HTML5 drag and drop events:
* `dragStart` * `dragStart`
* `drag` * `drag`
@ -15795,14 +15795,14 @@ Ember.View.reopenClass({
`className` and optional `falsyClassName`. `className` and optional `falsyClassName`.
- if a `className` or `falsyClassName` has been specified: - if a `className` or `falsyClassName` has been specified:
- if the value is truthy and `className` has been specified, - if the value is truthy and `className` has been specified,
`className` is returned `className` is returned
- if the value is falsy and `falsyClassName` has been specified, - if the value is falsy and `falsyClassName` has been specified,
`falsyClassName` is returned `falsyClassName` is returned
- otherwise `null` is returned - otherwise `null` is returned
- if the value is `true`, the dasherized last part of the supplied path - if the value is `true`, the dasherized last part of the supplied path
is returned is returned
- if the value is not `false`, `undefined` or `null`, the `value` - if the value is not `false`, `undefined` or `null`, the `value`
is returned is returned
- if none of the above rules apply, `null` is returned - if none of the above rules apply, `null` is returned
@ -16652,7 +16652,7 @@ var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
Given an empty `<body>` and the following code: Given an empty `<body>` and the following code:
```javascript ```javascript
someItemsView = Ember.CollectionView.create({ someItemsView = Ember.CollectionView.create({
classNames: ['a-collection'], classNames: ['a-collection'],
content: ['A','B','C'], content: ['A','B','C'],
@ -17824,7 +17824,7 @@ Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
## Example with bound options ## Example with bound options
Bound hash options are also supported. Example: Bound hash options are also supported. Example:
```handlebars ```handlebars
{{repeat text countBinding="numRepeats"}} {{repeat text countBinding="numRepeats"}}
@ -17862,15 +17862,15 @@ Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
{{concatenate prop1 prop2 prop3}}. If any of the properties change, {{concatenate prop1 prop2 prop3}}. If any of the properties change,
the helpr will re-render. Note that dependency keys cannot be the helpr will re-render. Note that dependency keys cannot be
using in conjunction with multi-property helpers, since it is ambiguous using in conjunction with multi-property helpers, since it is ambiguous
which property the dependent keys would belong to. which property the dependent keys would belong to.
## Use with unbound helper ## Use with unbound helper
The {{unbound}} helper can be used with bound helper invocations The {{unbound}} helper can be used with bound helper invocations
to render them in their unbound form, e.g. to render them in their unbound form, e.g.
```handlebars ```handlebars
{{unbound capitalize name}} {{unbound capitalize name}}
``` ```
In this example, if the name property changes, the helper In this example, if the name property changes, the helper
@ -17896,7 +17896,7 @@ Ember.Handlebars.registerBoundHelper = function(name, fn) {
view = data.view, view = data.view,
currentContext = (options.contexts && options.contexts[0]) || this, currentContext = (options.contexts && options.contexts[0]) || this,
normalized, normalized,
pathRoot, path, pathRoot, path,
loc, hashOption; loc, hashOption;
// Detect bound options (e.g. countBinding="otherCount") // Detect bound options (e.g. countBinding="otherCount")
@ -18002,7 +18002,7 @@ function evaluateMultiPropertyBoundHelper(context, fn, normalizedProperties, opt
// Assemble liast of watched properties that'll re-render this helper. // Assemble liast of watched properties that'll re-render this helper.
watchedProperties = []; watchedProperties = [];
for (boundOption in boundOptions) { for (boundOption in boundOptions) {
if (boundOptions.hasOwnProperty(boundOption)) { if (boundOptions.hasOwnProperty(boundOption)) {
watchedProperties.push(normalizePath(context, boundOptions[boundOption], data)); watchedProperties.push(normalizePath(context, boundOptions[boundOption], data));
} }
} }
@ -18937,14 +18937,14 @@ EmberHandlebars.registerHelper('unless', function(context, options) {
Result in the following rendered output: Result in the following rendered output:
```html ```html
<img class="aValue"> <img class="aValue">
``` ```
A boolean return value will insert a specified class name if the property A boolean return value will insert a specified class name if the property
returns `true` and remove the class name if the property returns `false`. returns `true` and remove the class name if the property returns `false`.
A class name is provided via the syntax A class name is provided via the syntax
`somePropertyName:class-name-if-true`. `somePropertyName:class-name-if-true`.
```javascript ```javascript
@ -19103,9 +19103,9 @@ EmberHandlebars.registerHelper('bindAttr', function(options) {
@method bindClasses @method bindClasses
@for Ember.Handlebars @for Ember.Handlebars
@param {Ember.Object} context The context from which to lookup properties @param {Ember.Object} context The context from which to lookup properties
@param {String} classBindings A string, space-separated, of class bindings @param {String} classBindings A string, space-separated, of class bindings
to use to use
@param {Ember.View} view The view in which observers should look for the @param {Ember.View} view The view in which observers should look for the
element to update element to update
@param {Srting} bindAttrId Optional bindAttr id used to lookup elements @param {Srting} bindAttrId Optional bindAttr id used to lookup elements
@return {Array} An array of class names to add @return {Array} An array of class names to add
@ -19795,7 +19795,7 @@ Ember.Handlebars.registerHelper('unbound', function(property, fn) {
// Unbound helper call. // Unbound helper call.
options.data.isUnbound = true; options.data.isUnbound = true;
helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing; helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;
out = helper.apply(this, Array.prototype.slice.call(arguments, 1)); out = helper.apply(this, Array.prototype.slice.call(arguments, 1));
delete options.data.isUnbound; delete options.data.isUnbound;
return out; return out;
} }
@ -21093,7 +21093,7 @@ helpers = helpers || Ember.Handlebars.helpers; data = data || {};
var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this; var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this;
function program1(depth0,data) { function program1(depth0,data) {
var buffer = '', hashTypes; var buffer = '', hashTypes;
data.buffer.push("<option value=\"\">"); data.buffer.push("<option value=\"\">");
hashTypes = {}; hashTypes = {};
@ -21103,7 +21103,7 @@ function program1(depth0,data) {
} }
function program3(depth0,data) { function program3(depth0,data) {
var hashTypes; var hashTypes;
hashTypes = {'contentBinding': "STRING"}; hashTypes = {'contentBinding': "STRING"};
data.buffer.push(escapeExpression(helpers.view.call(depth0, "Ember.SelectOption", {hash:{ data.buffer.push(escapeExpression(helpers.view.call(depth0, "Ember.SelectOption", {hash:{
@ -21118,7 +21118,7 @@ function program3(depth0,data) {
stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashTypes:hashTypes,data:data}); stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashTypes:hashTypes,data:data});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); } if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
return buffer; return buffer;
}), }),
attributeBindings: ['multiple', 'disabled', 'tabindex'], attributeBindings: ['multiple', 'disabled', 'tabindex'],

View file

@ -184,99 +184,99 @@ performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1; var $0 = $$.length - 1;
switch (yystate) { switch (yystate) {
case 1: return $$[$0-1]; case 1: return $$[$0-1];
break; break;
case 2: this.$ = new yy.ProgramNode([], $$[$0]); case 2: this.$ = new yy.ProgramNode([], $$[$0]);
break; break;
case 3: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]); case 3: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
break; break;
case 4: this.$ = new yy.ProgramNode($$[$0-1], []); case 4: this.$ = new yy.ProgramNode($$[$0-1], []);
break; break;
case 5: this.$ = new yy.ProgramNode($$[$0]); case 5: this.$ = new yy.ProgramNode($$[$0]);
break; break;
case 6: this.$ = new yy.ProgramNode([], []); case 6: this.$ = new yy.ProgramNode([], []);
break; break;
case 7: this.$ = new yy.ProgramNode([]); case 7: this.$ = new yy.ProgramNode([]);
break; break;
case 8: this.$ = [$$[$0]]; case 8: this.$ = [$$[$0]];
break; break;
case 9: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; case 9: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break; break;
case 10: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]); case 10: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
break; break;
case 11: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]); case 11: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
break; break;
case 12: this.$ = $$[$0]; case 12: this.$ = $$[$0];
break; break;
case 13: this.$ = $$[$0]; case 13: this.$ = $$[$0];
break; break;
case 14: this.$ = new yy.ContentNode($$[$0]); case 14: this.$ = new yy.ContentNode($$[$0]);
break; break;
case 15: this.$ = new yy.CommentNode($$[$0]); case 15: this.$ = new yy.CommentNode($$[$0]);
break; break;
case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
break; break;
case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
break; break;
case 18: this.$ = $$[$0-1]; case 18: this.$ = $$[$0-1];
break; break;
case 19: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); case 19: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
break; break;
case 20: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true); case 20: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
break; break;
case 21: this.$ = new yy.PartialNode($$[$0-1]); case 21: this.$ = new yy.PartialNode($$[$0-1]);
break; break;
case 22: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]); case 22: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
break; break;
case 23: case 23:
break; break;
case 24: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]; case 24: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
break; break;
case 25: this.$ = [[$$[$0-1]].concat($$[$0]), null]; case 25: this.$ = [[$$[$0-1]].concat($$[$0]), null];
break; break;
case 26: this.$ = [[$$[$0-1]], $$[$0]]; case 26: this.$ = [[$$[$0-1]], $$[$0]];
break; break;
case 27: this.$ = [[$$[$0]], null]; case 27: this.$ = [[$$[$0]], null];
break; break;
case 28: this.$ = [[new yy.DataNode($$[$0])], null]; case 28: this.$ = [[new yy.DataNode($$[$0])], null];
break; break;
case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break; break;
case 30: this.$ = [$$[$0]]; case 30: this.$ = [$$[$0]];
break; break;
case 31: this.$ = $$[$0]; case 31: this.$ = $$[$0];
break; break;
case 32: this.$ = new yy.StringNode($$[$0]); case 32: this.$ = new yy.StringNode($$[$0]);
break; break;
case 33: this.$ = new yy.IntegerNode($$[$0]); case 33: this.$ = new yy.IntegerNode($$[$0]);
break; break;
case 34: this.$ = new yy.BooleanNode($$[$0]); case 34: this.$ = new yy.BooleanNode($$[$0]);
break; break;
case 35: this.$ = new yy.DataNode($$[$0]); case 35: this.$ = new yy.DataNode($$[$0]);
break; break;
case 36: this.$ = new yy.HashNode($$[$0]); case 36: this.$ = new yy.HashNode($$[$0]);
break; break;
case 37: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; case 37: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break; break;
case 38: this.$ = [$$[$0]]; case 38: this.$ = [$$[$0]];
break; break;
case 39: this.$ = [$$[$0-2], $$[$0]]; case 39: this.$ = [$$[$0-2], $$[$0]];
break; break;
case 40: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]; case 40: this.$ = [$$[$0-2], new yy.StringNode($$[$0])];
break; break;
case 41: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]; case 41: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
break; break;
case 42: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]; case 42: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
break; break;
case 43: this.$ = [$$[$0-2], new yy.DataNode($$[$0])]; case 43: this.$ = [$$[$0-2], new yy.DataNode($$[$0])];
break; break;
case 44: this.$ = new yy.PartialNameNode($$[$0]); case 44: this.$ = new yy.PartialNameNode($$[$0]);
break; break;
case 45: this.$ = new yy.IdNode($$[$0]); case 45: this.$ = new yy.IdNode($$[$0]);
break; break;
case 46: $$[$0-2].push($$[$0]); this.$ = $$[$0-2]; case 46: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
break; break;
case 47: this.$ = [$$[$0]]; case 47: this.$ = [$$[$0]];
break; break;
} }
}, },
@ -566,75 +566,75 @@ case 0:
if(yy_.yytext.slice(-1) !== "\\") this.begin("mu"); if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu"); if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
if(yy_.yytext) return 14; if(yy_.yytext) return 14;
break; break;
case 1: return 14; case 1: return 14;
break; break;
case 2: case 2:
if(yy_.yytext.slice(-1) !== "\\") this.popState(); if(yy_.yytext.slice(-1) !== "\\") this.popState();
if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1); if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
return 14; return 14;
break; break;
case 3: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15; case 3: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15;
break; break;
case 4: this.begin("par"); return 24; case 4: this.begin("par"); return 24;
break; break;
case 5: return 16; case 5: return 16;
break; break;
case 6: return 20; case 6: return 20;
break; break;
case 7: return 19; case 7: return 19;
break; break;
case 8: return 19; case 8: return 19;
break; break;
case 9: return 23; case 9: return 23;
break; break;
case 10: return 23; case 10: return 23;
break; break;
case 11: this.popState(); this.begin('com'); case 11: this.popState(); this.begin('com');
break; break;
case 12: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; case 12: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
break; break;
case 13: return 22; case 13: return 22;
break; break;
case 14: return 36; case 14: return 36;
break; break;
case 15: return 35; case 15: return 35;
break; break;
case 16: return 35; case 16: return 35;
break; break;
case 17: return 39; case 17: return 39;
break; break;
case 18: /*ignore whitespace*/ case 18: /*ignore whitespace*/
break; break;
case 19: this.popState(); return 18; case 19: this.popState(); return 18;
break; break;
case 20: this.popState(); return 18; case 20: this.popState(); return 18;
break; break;
case 21: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30; case 21: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30;
break; break;
case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30; case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30;
break; break;
case 23: yy_.yytext = yy_.yytext.substr(1); return 28; case 23: yy_.yytext = yy_.yytext.substr(1); return 28;
break; break;
case 24: return 32; case 24: return 32;
break; break;
case 25: return 32; case 25: return 32;
break; break;
case 26: return 31; case 26: return 31;
break; break;
case 27: return 35; case 27: return 35;
break; break;
case 28: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35; case 28: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35;
break; break;
case 29: return 'INVALID'; case 29: return 'INVALID';
break; break;
case 30: /*ignore whitespace*/ case 30: /*ignore whitespace*/
break; break;
case 31: this.popState(); return 37; case 31: this.popState(); return 37;
break; break;
case 32: return 5; case 32: return 5;
break; break;
} }
}; };

View file

@ -1,7 +1,7 @@
/*! /*!
* jQuery replaceText - v1.1 - 11/21/2009 * jQuery replaceText - v1.1 - 11/21/2009
* http://benalman.com/projects/jquery-replacetext-plugin/ * http://benalman.com/projects/jquery-replacetext-plugin/
* *
* Copyright (c) 2009 "Cowboy" Ben Alman * Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses. * Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/ * http://benalman.com/about/license/
@ -10,58 +10,58 @@
// Script: jQuery replaceText: String replace for your jQueries! // Script: jQuery replaceText: String replace for your jQueries!
// //
// *Version: 1.1, Last updated: 11/21/2009* // *Version: 1.1, Last updated: 11/21/2009*
// //
// Project Home - http://benalman.com/projects/jquery-replacetext-plugin/ // Project Home - http://benalman.com/projects/jquery-replacetext-plugin/
// GitHub - http://github.com/cowboy/jquery-replacetext/ // GitHub - http://github.com/cowboy/jquery-replacetext/
// Source - http://github.com/cowboy/jquery-replacetext/raw/master/jquery.ba-replacetext.js // Source - http://github.com/cowboy/jquery-replacetext/raw/master/jquery.ba-replacetext.js
// (Minified) - http://github.com/cowboy/jquery-replacetext/raw/master/jquery.ba-replacetext.min.js (0.5kb) // (Minified) - http://github.com/cowboy/jquery-replacetext/raw/master/jquery.ba-replacetext.min.js (0.5kb)
// //
// About: License // About: License
// //
// Copyright (c) 2009 "Cowboy" Ben Alman, // Copyright (c) 2009 "Cowboy" Ben Alman,
// Dual licensed under the MIT and GPL licenses. // Dual licensed under the MIT and GPL licenses.
// http://benalman.com/about/license/ // http://benalman.com/about/license/
// //
// About: Examples // About: Examples
// //
// This working example, complete with fully commented code, illustrates one way // This working example, complete with fully commented code, illustrates one way
// in which this plugin can be used. // in which this plugin can be used.
// //
// replaceText - http://benalman.com/code/projects/jquery-replacetext/examples/replacetext/ // replaceText - http://benalman.com/code/projects/jquery-replacetext/examples/replacetext/
// //
// About: Support and Testing // About: Support and Testing
// //
// Information about what version or versions of jQuery this plugin has been // Information about what version or versions of jQuery this plugin has been
// tested with, and what browsers it has been tested in. // tested with, and what browsers it has been tested in.
// //
// jQuery Versions - 1.3.2, 1.4.1 // jQuery Versions - 1.3.2, 1.4.1
// Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1. // Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1.
// //
// About: Release History // About: Release History
// //
// 1.1 - (11/21/2009) Simplified the code and API substantially. // 1.1 - (11/21/2009) Simplified the code and API substantially.
// 1.0 - (11/21/2009) Initial release // 1.0 - (11/21/2009) Initial release
(function($){ (function($){
'$:nomunge'; // Used by YUI compressor. '$:nomunge'; // Used by YUI compressor.
// Method: jQuery.fn.replaceText // Method: jQuery.fn.replaceText
// //
// Replace text in specified elements. Note that only text content will be // Replace text in specified elements. Note that only text content will be
// modified, leaving all tags and attributes untouched. The new text can be // modified, leaving all tags and attributes untouched. The new text can be
// either text or HTML. // either text or HTML.
// //
// Uses the String prototype replace method, full documentation on that method // Uses the String prototype replace method, full documentation on that method
// can be found here: // can be found here:
// //
// https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/Replace // https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/Replace
// //
// Usage: // Usage:
// //
// > jQuery('selector').replaceText( search, replace [, text_only ] ); // > jQuery('selector').replaceText( search, replace [, text_only ] );
// //
// Arguments: // Arguments:
// //
// search - (RegExp|String) A RegExp object or substring to be replaced. // search - (RegExp|String) A RegExp object or substring to be replaced.
// Because the String prototype replace method is used internally, this // Because the String prototype replace method is used internally, this
// argument should be specified accordingly. // argument should be specified accordingly.
@ -71,43 +71,43 @@
// this argument should be specified accordingly. // this argument should be specified accordingly.
// text_only - (Boolean) If true, any HTML will be rendered as text. Defaults // text_only - (Boolean) If true, any HTML will be rendered as text. Defaults
// to false. // to false.
// //
// Returns: // Returns:
// //
// (jQuery) The initial jQuery collection of elements. // (jQuery) The initial jQuery collection of elements.
$.fn.replaceText = function( search, replace, text_only ) { $.fn.replaceText = function( search, replace, text_only ) {
return this.each(function(){ return this.each(function(){
var node = this.firstChild, var node = this.firstChild,
val, val,
new_val, new_val,
// Elements to be removed at the end. // Elements to be removed at the end.
remove = []; remove = [];
// Only continue if firstChild exists. // Only continue if firstChild exists.
if ( node ) { if ( node ) {
// Loop over all childNodes. // Loop over all childNodes.
do { do {
// Only process text nodes. // Only process text nodes.
if ( node.nodeType === 3 ) { if ( node.nodeType === 3 ) {
// The original node value. // The original node value.
val = node.nodeValue; val = node.nodeValue;
// The new value. // The new value.
new_val = val.replace( search, replace ); new_val = val.replace( search, replace );
// Only replace text if the new value is actually different! // Only replace text if the new value is actually different!
if ( new_val !== val ) { if ( new_val !== val ) {
if ( !text_only && /</.test( new_val ) ) { if ( !text_only && /</.test( new_val ) ) {
// The new value contains HTML, set it in a slower but far more // The new value contains HTML, set it in a slower but far more
// robust way. // robust way.
$(node).before( new_val ); $(node).before( new_val );
// Don't remove the node yet, or the loop will lose its place. // Don't remove the node yet, or the loop will lose its place.
remove.push( node ); remove.push( node );
} else { } else {
@ -117,13 +117,13 @@
} }
} }
} }
} while ( node = node.nextSibling ); } while ( node = node.nextSibling );
} }
// Time to remove those elements! // Time to remove those elements!
remove.length && $(remove).remove(); remove.length && $(remove).remove();
}); });
}; };
})(jQuery); })(jQuery);

View file

@ -72,14 +72,14 @@
input.data('tester_id', testerId); input.data('tester_id', testerId);
input.css('width', minWidth); input.css('width', minWidth);
}; };
$.fn.addTag = function(value,options) { $.fn.addTag = function(value,options) {
options = jQuery.extend({focus:false,callback:true},options); options = jQuery.extend({focus:false,callback:true},options);
this.each(function() { this.each(function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
var tagslist = $(this).val().split(delimiter[id]); var tagslist = $(this).val().split(delimiter[id]);
if (tagslist[0] == '') { if (tagslist[0] == '') {
tagslist = new Array(); tagslist = new Array();
} }
@ -92,10 +92,10 @@
$('#'+id+'_tag').addClass('not_valid'); $('#'+id+'_tag').addClass('not_valid');
} }
} else { } else {
var skipTag = false; var skipTag = false;
} }
if (value !='' && skipTag != true) { if (value !='' && skipTag != true) {
$('<span>').addClass('tag').append( $('<span>').addClass('tag').append(
$('<span>').text(value).append('&nbsp;&nbsp;'), $('<span>').text(value).append('&nbsp;&nbsp;'),
$('<a>', { $('<a>', {
@ -135,17 +135,17 @@
return false; return false;
}; };
$.fn.removeTag = function(value) { $.fn.removeTag = function(value) {
value = unescape(value); value = unescape(value);
this.each(function() { this.each(function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
var old = $(this).val().split(delimiter[id]); var old = $(this).val().split(delimiter[id]);
$('#'+id+'_tagsinput .tag').remove(); $('#'+id+'_tagsinput .tag').remove();
str = ''; str = '';
for (i=0; i< old.length; i++) { for (i=0; i< old.length; i++) {
if (old[i]!=value) { if (old[i]!=value) {
str = str + delimiter[id] +old[i]; str = str + delimiter[id] +old[i];
} }
} }
@ -174,7 +174,7 @@
$.fn.tagsInput.importTags(this,str); $.fn.tagsInput.importTags(this,str);
} }
$.fn.tagsInput = function(options) { $.fn.tagsInput = function(options) {
var settings = jQuery.extend({ var settings = jQuery.extend({
interactive:true, interactive:true,
defaultText:'add a tag', defaultText:'add a tag',
@ -191,8 +191,8 @@
inputPadding: 6*2 inputPadding: 6*2
},options); },options);
this.each(function() { this.each(function() {
if (settings.hide) { if (settings.hide) {
$(this).hide(); $(this).hide();
} }
var id = $(this).attr('id'); var id = $(this).attr('id');
@ -231,10 +231,10 @@
$(data.holder).css('min-height',settings.height); $(data.holder).css('min-height',settings.height);
$(data.holder).css('height','100%'); $(data.holder).css('height','100%');
if ($(data.real_input).val()!='') { if ($(data.real_input).val()!='') {
$.fn.tagsInput.importTags($(data.real_input),$(data.real_input).val()); $.fn.tagsInput.importTags($(data.real_input),$(data.real_input).val());
} }
if (settings.interactive) { if (settings.interactive) {
$(data.fake_input).resetAutosize(settings); $(data.fake_input).resetAutosize(settings);
$(data.holder).bind('click',data,function(event) { $(data.holder).bind('click',data,function(event) {
@ -244,8 +244,8 @@
if (settings.autocomplete_url != undefined) { if (settings.autocomplete_url != undefined) {
autocomplete_options = {source: settings.autocomplete_url}; autocomplete_options = {source: settings.autocomplete_url};
for (attrname in settings.autocomplete) { for (attrname in settings.autocomplete) {
autocomplete_options[attrname] = settings.autocomplete[attrname]; autocomplete_options[attrname] = settings.autocomplete[attrname];
} }
if (jQuery.Autocompleter !== undefined) { if (jQuery.Autocompleter !== undefined) {
@ -267,9 +267,9 @@
} else { } else {
// if a user tabs out of the field, create a new tag // if a user tabs out of the field, create a new tag
// this is only available if autocomplete is not used. // this is only available if autocomplete is not used.
$(data.fake_input).bind('blur',data,function(event) { $(data.fake_input).bind('blur',data,function(event) {
var d = $(this).attr('data-default'); var d = $(this).attr('data-default');
if ($(event.data.fake_input).val()!='' && $(event.data.fake_input).val()!=d) { if ($(event.data.fake_input).val()!='' && $(event.data.fake_input).val()!=d) {
if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) ) if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
$(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)}); $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
} else { } else {
@ -290,7 +290,7 @@
return false; return false;
} else if (event.data.autosize) { } else if (event.data.autosize) {
$(event.data.fake_input).doAutosize(settings); $(event.data.fake_input).doAutosize(settings);
} }
}); });
//Delete last tag on backspace //Delete last tag on backspace
@ -323,7 +323,7 @@
}; };
$.fn.tagsInput.updateTagsField = function(obj,tagslist) { $.fn.tagsInput.updateTagsField = function(obj,tagslist) {
var id = $(obj).attr('id'); var id = $(obj).attr('id');
$(obj).val(tagslist.join(delimiter[id])); $(obj).val(tagslist.join(delimiter[id]));
}; };
@ -332,7 +332,7 @@
$(obj).val(''); $(obj).val('');
var id = $(obj).attr('id'); var id = $(obj).attr('id');
var tags = val.split(delimiter[id]); var tags = val.split(delimiter[id]);
for (i=0; i<tags.length; i++) { for (i=0; i<tags.length; i++) {
$(obj).addTag(tags[i],{focus:false,callback:false}); $(obj).addTag(tags[i],{focus:false,callback:false});
} }
if(tags_callbacks[id] && tags_callbacks[id]['onChange']) if(tags_callbacks[id] && tags_callbacks[id]['onChange'])

View file

@ -829,25 +829,25 @@
Mousetrap = (function(Mousetrap) { Mousetrap = (function(Mousetrap) {
var _global_callbacks = {}, var _global_callbacks = {},
_original_stop_callback = Mousetrap.stopCallback; _original_stop_callback = Mousetrap.stopCallback;
Mousetrap.stopCallback = function(e, element, combo) { Mousetrap.stopCallback = function(e, element, combo) {
if (_global_callbacks[combo]) { if (_global_callbacks[combo]) {
return false; return false;
} }
return _original_stop_callback(e, element, combo); return _original_stop_callback(e, element, combo);
}; };
Mousetrap.bindGlobal = function(keys, callback, action) { Mousetrap.bindGlobal = function(keys, callback, action) {
Mousetrap.bind(keys, callback, action); Mousetrap.bind(keys, callback, action);
if (keys instanceof Array) { if (keys instanceof Array) {
for (var i = 0; i < keys.length; i++) { for (var i = 0; i < keys.length; i++) {
_global_callbacks[keys[i]] = true; _global_callbacks[keys[i]] = true;
} }
return; return;
} }
_global_callbacks[keys] = true; _global_callbacks[keys] = true;
}; };
@ -859,6 +859,6 @@ Mousetrap = (function(Mousetrap) {
return; return;
} }
}; };
return Mousetrap; return Mousetrap;
}) (Mousetrap); }) (Mousetrap);

View file

@ -1,8 +1,8 @@
// Animates the dimensional changes resulting from altering element contents // Animates the dimensional changes resulting from altering element contents
// Usage examples: // Usage examples:
// $("#myElement").showHtml("new HTML contents"); // $("#myElement").showHtml("new HTML contents");
// $("div").showHtml("new HTML contents", 400); // $("div").showHtml("new HTML contents", 400);
// $(".className").showHtml("new HTML contents", 400, // $(".className").showHtml("new HTML contents", 400,
// function() {/* on completion */}); // function() {/* on completion */});
(function($) (function($)
{ {
@ -13,22 +13,22 @@
// The element to be modified // The element to be modified
var el = $(this); var el = $(this);
// Preserve the original values of width and height - they'll need // Preserve the original values of width and height - they'll need
// to be modified during the animation, but can be restored once // to be modified during the animation, but can be restored once
// the animation has completed. // the animation has completed.
var finish = {width: this.style.width, height: this.style.height}; var finish = {width: this.style.width, height: this.style.height};
// The original width and height represented as pixel values. // The original width and height represented as pixel values.
// These will only be the same as `finish` if this element had its // These will only be the same as `finish` if this element had its
// dimensions specified explicitly and in pixels. Of course, if that // dimensions specified explicitly and in pixels. Of course, if that
// was done then this entire routine is pointless, as the dimensions // was done then this entire routine is pointless, as the dimensions
// won't change when the content is changed. // won't change when the content is changed.
var cur = {width: el.width()+'px', height: el.height()+'px'}; var cur = {width: el.width()+'px', height: el.height()+'px'};
// Modify the element's contents. Element will resize. // Modify the element's contents. Element will resize.
el.html(html); el.html(html);
// Capture the final dimensions of the element // Capture the final dimensions of the element
// (with initial style settings still in effect) // (with initial style settings still in effect)
var next = {width: el.width()+'px', height: el.height()+'px'}; var next = {width: el.width()+'px', height: el.height()+'px'};
@ -42,4 +42,4 @@
}; };
})(jQuery); })(jQuery);

View file

@ -1596,7 +1596,7 @@ var MapWithDefault = Ember.MapWithDefault = function(options) {
@static @static
@param [options] @param [options]
@param {anything} [options.defaultValue] @param {anything} [options.defaultValue]
@return {Ember.MapWithDefault|Ember.Map} If options are passed, returns @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns
`Ember.MapWithDefault` otherwise returns `Ember.Map` `Ember.MapWithDefault` otherwise returns `Ember.Map`
*/ */
MapWithDefault.create = function(options) { MapWithDefault.create = function(options) {
@ -1670,7 +1670,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
If you plan to run on IE8 and older browsers then you should use this If you plan to run on IE8 and older browsers then you should use this
method anytime you want to retrieve a property on an object that you don't method anytime you want to retrieve a property on an object that you don't
know for sure is private. (Properties beginning with an underscore '_' know for sure is private. (Properties beginning with an underscore '_'
are considered private.) are considered private.)
On all newer browsers, you only need to use this method to retrieve On all newer browsers, you only need to use this method to retrieve
@ -1731,7 +1731,7 @@ get = function get(obj, keyName) {
If you plan to run on IE8 and older browsers then you should use this If you plan to run on IE8 and older browsers then you should use this
method anytime you want to set a property on an object that you don't method anytime you want to set a property on an object that you don't
know for sure is private. (Properties beginning with an underscore '_' know for sure is private. (Properties beginning with an underscore '_'
are considered private.) are considered private.)
On all newer browsers, you only need to use this method to set On all newer browsers, you only need to use this method to set
@ -4069,7 +4069,7 @@ Ember.RunLoop = RunLoop;
```javascript ```javascript
Ember.run(function(){ Ember.run(function(){
// code to be execute within a RunLoop // code to be execute within a RunLoop
}); });
``` ```
@ -4108,7 +4108,7 @@ var run = Ember.run;
```javascript ```javascript
Ember.run.begin(); Ember.run.begin();
// code to be execute within a RunLoop // code to be execute within a RunLoop
Ember.run.end(); Ember.run.end();
``` ```
@ -4126,7 +4126,7 @@ Ember.run.begin = function() {
```javascript ```javascript
Ember.run.begin(); Ember.run.begin();
// code to be execute within a RunLoop // code to be execute within a RunLoop
Ember.run.end(); Ember.run.end();
``` ```
@ -7197,7 +7197,7 @@ Ember.Enumerable = Ember.Mixin.create(
@method nextObject @method nextObject
@param {Number} index the current index of the iteration @param {Number} index the current index of the iteration
@param {Object} previousObject the value returned by the last call to @param {Object} previousObject the value returned by the last call to
`nextObject`. `nextObject`.
@param {Object} context a context object you can use to maintain state. @param {Object} context a context object you can use to maintain state.
@return {Object} the next object in the iteration or undefined @return {Object} the next object in the iteration or undefined
@ -8264,9 +8264,9 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
@method arrayContentWillChange @method arrayContentWillChange
@param {Number} startIdx The starting index in the array that will change. @param {Number} startIdx The starting index in the array that will change.
@param {Number} removeAmt The number of items that will be removed. If you @param {Number} removeAmt The number of items that will be removed. If you
pass `null` assumes 0 pass `null` assumes 0
@param {Number} addAmt The number of items that will be added If you @param {Number} addAmt The number of items that will be added If you
pass `null` assumes 0. pass `null` assumes 0.
@return {Ember.Array} receiver @return {Ember.Array} receiver
*/ */
@ -8740,11 +8740,11 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
passed array. You should also call `this.enumerableContentDidChange()` passed array. You should also call `this.enumerableContentDidChange()`
@method replace @method replace
@param {Number} idx Starting index in the array to replace. If @param {Number} idx Starting index in the array to replace. If
idx >= length, then append to the end of the array. idx >= length, then append to the end of the array.
@param {Number} amt Number of elements that should be removed from @param {Number} amt Number of elements that should be removed from
the array, starting at *idx*. the array, starting at *idx*.
@param {Array} objects An array of zero or more objects that should be @param {Array} objects An array of zero or more objects that should be
inserted into the array at *idx* inserted into the array at *idx*
*/ */
replace: Ember.required(), replace: Ember.required(),
@ -9998,14 +9998,14 @@ CoreObject.PrototypeMixin = Mixin.create({
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz'] view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
``` ```
Adding a single property that is not an array will just add it in the array: Adding a single property that is not an array will just add it in the array:
```javascript ```javascript
var view = App.FooBarView.create({ var view = App.FooBarView.create({
classNames: 'baz' classNames: 'baz'
}) })
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz'] view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
``` ```
Using the `concatenatedProperties` property, we can tell to Ember that mix Using the `concatenatedProperties` property, we can tell to Ember that mix
the content of the properties. the content of the properties.
@ -14080,7 +14080,7 @@ class:
* `mouseEnter` * `mouseEnter`
* `mouseLeave` * `mouseLeave`
Form events: Form events:
* `submit` * `submit`
* `change` * `change`
@ -14088,7 +14088,7 @@ class:
* `focusOut` * `focusOut`
* `input` * `input`
HTML5 drag and drop events: HTML5 drag and drop events:
* `dragStart` * `dragStart`
* `drag` * `drag`
@ -15619,14 +15619,14 @@ Ember.View.reopenClass({
`className` and optional `falsyClassName`. `className` and optional `falsyClassName`.
- if a `className` or `falsyClassName` has been specified: - if a `className` or `falsyClassName` has been specified:
- if the value is truthy and `className` has been specified, - if the value is truthy and `className` has been specified,
`className` is returned `className` is returned
- if the value is falsy and `falsyClassName` has been specified, - if the value is falsy and `falsyClassName` has been specified,
`falsyClassName` is returned `falsyClassName` is returned
- otherwise `null` is returned - otherwise `null` is returned
- if the value is `true`, the dasherized last part of the supplied path - if the value is `true`, the dasherized last part of the supplied path
is returned is returned
- if the value is not `false`, `undefined` or `null`, the `value` - if the value is not `false`, `undefined` or `null`, the `value`
is returned is returned
- if none of the above rules apply, `null` is returned - if none of the above rules apply, `null` is returned
@ -16476,7 +16476,7 @@ var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
Given an empty `<body>` and the following code: Given an empty `<body>` and the following code:
```javascript ```javascript
someItemsView = Ember.CollectionView.create({ someItemsView = Ember.CollectionView.create({
classNames: ['a-collection'], classNames: ['a-collection'],
content: ['A','B','C'], content: ['A','B','C'],
@ -17647,7 +17647,7 @@ Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
## Example with bound options ## Example with bound options
Bound hash options are also supported. Example: Bound hash options are also supported. Example:
```handlebars ```handlebars
{{repeat text countBinding="numRepeats"}} {{repeat text countBinding="numRepeats"}}
@ -17685,15 +17685,15 @@ Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
{{concatenate prop1 prop2 prop3}}. If any of the properties change, {{concatenate prop1 prop2 prop3}}. If any of the properties change,
the helpr will re-render. Note that dependency keys cannot be the helpr will re-render. Note that dependency keys cannot be
using in conjunction with multi-property helpers, since it is ambiguous using in conjunction with multi-property helpers, since it is ambiguous
which property the dependent keys would belong to. which property the dependent keys would belong to.
## Use with unbound helper ## Use with unbound helper
The {{unbound}} helper can be used with bound helper invocations The {{unbound}} helper can be used with bound helper invocations
to render them in their unbound form, e.g. to render them in their unbound form, e.g.
```handlebars ```handlebars
{{unbound capitalize name}} {{unbound capitalize name}}
``` ```
In this example, if the name property changes, the helper In this example, if the name property changes, the helper
@ -17719,7 +17719,7 @@ Ember.Handlebars.registerBoundHelper = function(name, fn) {
view = data.view, view = data.view,
currentContext = (options.contexts && options.contexts[0]) || this, currentContext = (options.contexts && options.contexts[0]) || this,
normalized, normalized,
pathRoot, path, pathRoot, path,
loc, hashOption; loc, hashOption;
// Detect bound options (e.g. countBinding="otherCount") // Detect bound options (e.g. countBinding="otherCount")
@ -17824,7 +17824,7 @@ function evaluateMultiPropertyBoundHelper(context, fn, normalizedProperties, opt
// Assemble liast of watched properties that'll re-render this helper. // Assemble liast of watched properties that'll re-render this helper.
watchedProperties = []; watchedProperties = [];
for (boundOption in boundOptions) { for (boundOption in boundOptions) {
if (boundOptions.hasOwnProperty(boundOption)) { if (boundOptions.hasOwnProperty(boundOption)) {
watchedProperties.push(normalizePath(context, boundOptions[boundOption], data)); watchedProperties.push(normalizePath(context, boundOptions[boundOption], data));
} }
} }
@ -18757,14 +18757,14 @@ EmberHandlebars.registerHelper('unless', function(context, options) {
Result in the following rendered output: Result in the following rendered output:
```html ```html
<img class="aValue"> <img class="aValue">
``` ```
A boolean return value will insert a specified class name if the property A boolean return value will insert a specified class name if the property
returns `true` and remove the class name if the property returns `false`. returns `true` and remove the class name if the property returns `false`.
A class name is provided via the syntax A class name is provided via the syntax
`somePropertyName:class-name-if-true`. `somePropertyName:class-name-if-true`.
```javascript ```javascript
@ -18919,9 +18919,9 @@ EmberHandlebars.registerHelper('bindAttr', function(options) {
@method bindClasses @method bindClasses
@for Ember.Handlebars @for Ember.Handlebars
@param {Ember.Object} context The context from which to lookup properties @param {Ember.Object} context The context from which to lookup properties
@param {String} classBindings A string, space-separated, of class bindings @param {String} classBindings A string, space-separated, of class bindings
to use to use
@param {Ember.View} view The view in which observers should look for the @param {Ember.View} view The view in which observers should look for the
element to update element to update
@param {Srting} bindAttrId Optional bindAttr id used to lookup elements @param {Srting} bindAttrId Optional bindAttr id used to lookup elements
@return {Array} An array of class names to add @return {Array} An array of class names to add
@ -19610,7 +19610,7 @@ Ember.Handlebars.registerHelper('unbound', function(property, fn) {
// Unbound helper call. // Unbound helper call.
options.data.isUnbound = true; options.data.isUnbound = true;
helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing; helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;
out = helper.apply(this, Array.prototype.slice.call(arguments, 1)); out = helper.apply(this, Array.prototype.slice.call(arguments, 1));
delete options.data.isUnbound; delete options.data.isUnbound;
return out; return out;
} }
@ -20905,7 +20905,7 @@ helpers = helpers || Ember.Handlebars.helpers; data = data || {};
var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this; var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this;
function program1(depth0,data) { function program1(depth0,data) {
var buffer = '', hashTypes; var buffer = '', hashTypes;
data.buffer.push("<option value=\"\">"); data.buffer.push("<option value=\"\">");
hashTypes = {}; hashTypes = {};
@ -20915,7 +20915,7 @@ function program1(depth0,data) {
} }
function program3(depth0,data) { function program3(depth0,data) {
var hashTypes; var hashTypes;
hashTypes = {'contentBinding': "STRING"}; hashTypes = {'contentBinding': "STRING"};
data.buffer.push(escapeExpression(helpers.view.call(depth0, "Ember.SelectOption", {hash:{ data.buffer.push(escapeExpression(helpers.view.call(depth0, "Ember.SelectOption", {hash:{
@ -20930,7 +20930,7 @@ function program3(depth0,data) {
stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashTypes:hashTypes,data:data}); stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashTypes:hashTypes,data:data});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); } if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
return buffer; return buffer;
}), }),
attributeBindings: ['multiple', 'disabled', 'tabindex'], attributeBindings: ['multiple', 'disabled', 'tabindex'],

View file

@ -272,7 +272,7 @@ table {
.excerpt { .excerpt {
width: 600px; padding: 0 10px 10px 0; width: 600px; padding: 0 10px 10px 0;
.icon,h3 { display: inline-block; } .icon,h3 { display: inline-block; }
} }
.flaggers { padding: 0 10px; } .flaggers { padding: 0 10px; }
.last-flagged { padding: 0 10px; } .last-flagged { padding: 0 10px; }

View file

@ -55,7 +55,7 @@ body {
border-top-color: white; border-top-color: white;
border-bottom-color: white; border-bottom-color: white;
} }
.caret { .caret {
opacity: 0.9; opacity: 0.9;
filter: alpha(opacity = 90); filter: alpha(opacity = 90);
@ -306,4 +306,4 @@ blockquote {
.profiler-results.profiler-left { .profiler-results.profiler-left {
top: 60px !important; top: 60px !important;
} }

View file

@ -229,7 +229,7 @@
} }
// Categories // Categories
.category { .category {
float: left; float: left;
background-color: transparent; background-color: transparent;

View file

@ -14,7 +14,7 @@
.cboxIframe{width:100%; height:100%; display:block; border:0;} .cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/* /*
User Style: User Style:
Change the following styles to modify the appearance of ColorBox. They are Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML. ordered & tabbed in a way that represents the nesting of the generated HTML.
@ -39,7 +39,7 @@
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}

View file

@ -1,5 +1,5 @@
@media only screen @media only screen
and (min-device-width : 320px) and (min-device-width : 320px)
and (max-device-width : 540px) { and (max-device-width : 540px) {
#reply-control { #reply-control {
.toggle-preview { display:none; } .toggle-preview { display:none; }
@ -7,7 +7,7 @@ and (max-device-width : 540px) {
.wmd-controls { .wmd-controls {
#wmd-input { #wmd-input {
width: 100%; width: 100%;
border-top: 0; border-top: 0;
} }
.preview-wrapper { .preview-wrapper {
display: none; display: none;

View file

@ -52,7 +52,7 @@
*border: 1px solid #999; *border: 1px solid #999;
/* IE6-7 */ /* IE6-7 */
@include border-radius-all (6px); @include border-radius-all (6px);
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
@ -106,19 +106,19 @@
border-bottom: 1px solid #9baab2; border-bottom: 1px solid #9baab2;
@include box-shadow((0 1px 3px rgba($black, 0.12), inset 0 -4px 4px -4px rgba($black, 0.3))); @include box-shadow((0 1px 3px rgba($black, 0.12), inset 0 -4px 4px -4px rgba($black, 0.3)));
h3 { h3 {
color: $nav-pills-background-color-active; color: $nav-pills-background-color-active;
font-size: 20px; font-size: 20px;
padding: 10px 15px 7px; padding: 10px 15px 7px;
} }
.close { .close {
float: right; float: right;
font-size: 20px; font-size: 20px;
margin: 10px 10px 0px; margin: 10px 10px 0px;
text-decoration: none; text-decoration: none;
color: $modal-close-button-color; color: $modal-close-button-color;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: darken($modal-close-button-color,20); color: darken($modal-close-button-color,20);
} }
} }
} }

View file

@ -234,7 +234,7 @@
} }
section.post-menu-area { section.post-menu-area {
background-color: $post_footer; background-color: $post_footer;
border-top: 1px solid $inner_border; border-top: 1px solid $inner_border;
overflow: hidden; overflow: hidden;
@include box-shadow(inset 0 -4px 4px -4px rgba($black, 0.14)); @include box-shadow(inset 0 -4px 4px -4px rgba($black, 0.14));
@ -544,7 +544,7 @@
} }
.contents.bottom-round { .contents.bottom-round {
overflow: hidden; overflow: hidden;
background-clip: padding-box; background-clip: padding-box;
@include border-radius-bottom(4px); @include border-radius-bottom(4px);
@include box-shadow(0 1px 2px rgba($black, 0.07)); @include box-shadow(0 1px 2px rgba($black, 0.07));
} }
@ -599,7 +599,7 @@
} }
.topic-post.hidden { .topic-post.hidden {
display: block; display: block;
opacity: 0.4; opacity: 0.4;
} }
@ -607,7 +607,7 @@
opacity: 0.8; opacity: 0.8;
article.boxed { article.boxed {
.topic-body .contents { .topic-body .contents {
background-color: #ffcece; background-color: #ffcece;
} }
.topic-body::after { .topic-body::after {
border-right-color: #ffcece; border-right-color: #ffcece;

View file

@ -279,12 +279,12 @@
} }
} }
// styling of bottom section // styling of bottom section
#user-stream .child-actions { #user-stream .child-actions {
margin-top: 8px; margin-top: 8px;
.avatar-link { .avatar-link {
float: none; float: none;
} }
.icon { .icon {
width: 15px; width: 15px;
display: inline-block; display: inline-block;

View file

@ -1,33 +1,33 @@
div.tagsinput { div.tagsinput {
border:1px solid #CCC; border:1px solid #CCC;
background: #FFF; background: #FFF;
padding:5px 5px 0px; padding:5px 5px 0px;
width:584px; width:584px;
height:100px; height:100px;
overflow-y: auto; overflow-y: auto;
border-radius: 4px; border-radius: 4px;
} }
div.tagsinput span.tag { div.tagsinput span.tag {
border: 1px solid #a5d24a; border: 1px solid #a5d24a;
-moz-border-radius:2px; -moz-border-radius:2px;
-webkit-border-radius:2px; -webkit-border-radius:2px;
border-radius: 2px; border-radius: 2px;
display: block; display: block;
float: left; float: left;
padding: 1px 5px; padding: 1px 5px;
text-decoration:none; text-decoration:none;
background: #cde69c; background: #cde69c;
color: #638421; color: #638421;
margin-right: 5px; margin-right: 5px;
margin-bottom:5px; margin-bottom:5px;
font-family: helvetica; font-family: helvetica;
font-size:13px; font-size:13px;
} }
div.tagsinput span.tag a { font-weight: bold; color: #82ad2b; text-decoration:none; font-size: 11px; } div.tagsinput span.tag a { font-weight: bold; color: #82ad2b; text-decoration:none; font-size: 11px; }
div.tagsinput input { width:80px; margin:0px; font-family: helvetica; font-size: 13px; border:1px solid transparent; div.tagsinput input { width:80px; margin:0px; font-family: helvetica; font-size: 13px; border:1px solid transparent;
padding:2px 5px; background: transparent; color: #000; outline:0px; margin-right:5px; margin-bottom:5px; } padding:2px 5px; background: transparent; color: #000; outline:0px; margin-right:5px; margin-bottom:5px; }
div.tagsinput div { display:block; float: left; } div.tagsinput div { display:block; float: left; }
.tags_clear { clear: both; width: 100%; height: 0px; } .tags_clear { clear: both; width: 100%; height: 0px; }
.not_valid {background: #FBD8DB !important; color: #90111A !important;} .not_valid {background: #FBD8DB !important; color: #90111A !important;}

View file

@ -13,7 +13,7 @@
*/ */
@import "foundation/mixins"; @import "foundation/mixins";
.input-block-level { .input-block-level {
display: block; display: block;
width: 100%; width: 100%;
@ -1185,7 +1185,7 @@ body {
/* For IE7, add top margin to align select with labels */ /* For IE7, add top margin to align select with labels */
line-height: 28px; line-height: 28px;
} }
select { select {
width: 220px; width: 220px;
border: 1px solid #bbbbbb; border: 1px solid #bbbbbb;

View file

@ -26,13 +26,13 @@
/* @group Single Chosen */ /* @group Single Chosen */
.chzn-container-single .chzn-single { .chzn-container-single .chzn-single {
background-color: #ffffff; background-color: #ffffff;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: -ms-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-image: -ms-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-image: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-image: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
-webkit-border-radius: 5px; -webkit-border-radius: 5px;
-moz-border-radius : 5px; -moz-border-radius : 5px;
border-radius : 5px; border-radius : 5px;
@ -182,13 +182,13 @@
-webkit-background-clip: padding-box; -webkit-background-clip: padding-box;
background-clip : padding-box; background-clip : padding-box;
background-color: #e4e4e4; background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
@ -248,7 +248,7 @@
} }
.chzn-container .chzn-results .highlighted { .chzn-container .chzn-results .highlighted {
background-color: #3875d7; background-color: #3875d7;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%); background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%); background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
@ -384,7 +384,7 @@
.chzn-rtl .chzn-search input { .chzn-rtl .chzn-search input {
background: #fff url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px; background: #fff url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px;
background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); background: url(<%=asset_path "chosen-sprite.png"%>) no-repeat -38px -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
@ -392,4 +392,4 @@
padding: 4px 5px 4px 20px; padding: 4px 5px 4px 20px;
direction: rtl; direction: rtl;
} }
/* @end */ /* @end */

View file

@ -7,7 +7,7 @@ require_dependency 'rate_limiter'
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
include CurrentUser include CurrentUser
include CanonicalURL::ControllerExtensions include CanonicalURL::ControllerExtensions
serialization_scope :guardian serialization_scope :guardian
@ -79,8 +79,8 @@ class ApplicationController < ActionController::Base
def store_preloaded(key, json) def store_preloaded(key, json)
@preloaded ||= {} @preloaded ||= {}
# I dislike that there is a gsub as opposed to a gsub! # I dislike that there is a gsub as opposed to a gsub!
# but we can not be mucking with user input, I wonder if there is a way # but we can not be mucking with user input, I wonder if there is a way
# to inject this safty deeper in the library or even in AM serializer # to inject this safty deeper in the library or even in AM serializer
@preloaded[key] = json.gsub("</", "<\\/") @preloaded[key] = json.gsub("</", "<\\/")
end end

View file

@ -5,11 +5,11 @@ class EducationController < ApplicationController
def show def show
raise Discourse::InvalidAccess.new unless params[:id] =~ /^[a-z0-9\-\_]+$/ raise Discourse::InvalidAccess.new unless params[:id] =~ /^[a-z0-9\-\_]+$/
raise Discourse::NotFound.new unless I18n.t(:education).include?(params[:id].to_sym) raise Discourse::NotFound.new unless I18n.t(:education).include?(params[:id].to_sym)
education_posts_text = I18n.t('education.until_posts', count: SiteSetting.educate_until_posts) education_posts_text = I18n.t('education.until_posts', count: SiteSetting.educate_until_posts)
markdown_content = MultisiteI18n.t("education.#{params[:id]}", markdown_content = MultisiteI18n.t("education.#{params[:id]}",
site_name: SiteSetting.title, site_name: SiteSetting.title,
education_posts_text: education_posts_text) education_posts_text: education_posts_text)
render text: PrettyText.cook(markdown_content) render text: PrettyText.cook(markdown_content)
end end

View file

@ -72,7 +72,7 @@ class PostActionsController < ApplicationController
finder = Post.where(id: params[:id]) finder = Post.where(id: params[:id])
# Include deleted posts if the user is a moderator # Include deleted posts if the user is a moderator
finder = finder.with_deleted if current_user.try(:has_trust_level?, :moderator) finder = finder.with_deleted if current_user.try(:has_trust_level?, :moderator)
@post = finder.first @post = finder.first
guardian.ensure_can_see!(@post) guardian.ensure_can_see!(@post)

View file

@ -57,7 +57,7 @@ class PostsController < ApplicationController
result = {post: post_serializer.as_json} result = {post: post_serializer.as_json}
if revisor.category_changed.present? if revisor.category_changed.present?
result[:category] = CategorySerializer.new(revisor.category_changed, scope: guardian, root: false).as_json result[:category] = CategorySerializer.new(revisor.category_changed, scope: guardian, root: false).as_json
end end
render_json_dump(result) render_json_dump(result)
@ -127,7 +127,7 @@ class PostsController < ApplicationController
# Returns the "you're creating a post education" # Returns the "you're creating a post education"
def education_text def education_text
end end
def bookmark def bookmark
@ -149,10 +149,10 @@ class PostsController < ApplicationController
finder = Post.where(id: params[:id] || params[:post_id]) finder = Post.where(id: params[:id] || params[:post_id])
# Include deleted posts if the user is a moderator # Include deleted posts if the user is a moderator
finder = finder.with_deleted if current_user.try(:has_trust_level?, :moderator) finder = finder.with_deleted if current_user.try(:has_trust_level?, :moderator)
post = finder.first post = finder.first
guardian.ensure_can_see!(post) guardian.ensure_can_see!(post)
post post
end end
end end

View file

@ -9,7 +9,7 @@ class RobotsTxtController < ApplicationController
else else
:no_index :no_index
end end
render path, content_type: 'text/plain' render path, content_type: 'text/plain'
end end
end end

View file

@ -26,7 +26,7 @@ class Category < ActiveRecord::Base
def self.popular def self.popular
order('topic_count desc') order('topic_count desc')
end end
# Recalculates `topics_year`, `topics_month`, and `topics_week` # Recalculates `topics_year`, `topics_month`, and `topics_week`
# for each Category. # for each Category.
def self.update_stats def self.update_stats
@ -38,9 +38,9 @@ class Category < ActiveRecord::Base
topics_year = topics.created_since(1.year.ago).to_sql topics_year = topics.created_since(1.year.ago).to_sql
topics_month = topics.created_since(1.month.ago).to_sql topics_month = topics.created_since(1.month.ago).to_sql
topics_week = topics.created_since(1.week.ago).to_sql topics_week = topics.created_since(1.week.ago).to_sql
Category.update_all("topics_year = (#{topics_year}), Category.update_all("topics_year = (#{topics_year}),
topics_month = (#{topics_month}), topics_month = (#{topics_month}),
topics_week = (#{topics_week})") topics_week = (#{topics_week})")
end end

View file

@ -9,7 +9,7 @@ class CategoryList
.includes(:featured_users) .includes(:featured_users)
.order('topics_week desc, topics_month desc, topics_year desc') .order('topics_week desc, topics_month desc, topics_year desc')
.to_a .to_a
# Support for uncategorized topics # Support for uncategorized topics
uncategorized_topics = Topic uncategorized_topics = Topic
.listable_topics .listable_topics

View file

@ -171,7 +171,7 @@ class Post < ActiveRecord::Base
# As a moderator, delete the post. # As a moderator, delete the post.
Post.transaction do Post.transaction do
self.destroy self.destroy
Topic.reset_highest(self.topic_id) Topic.reset_highest(self.topic_id)
end end
elsif deleted_by.id == self.user_id elsif deleted_by.id == self.user_id
# As the poster, make a revision that says deleted. # As the poster, make a revision that says deleted.

View file

@ -21,7 +21,7 @@ class PostAction < ActiveRecord::Base
def self.update_flagged_posts_count def self.update_flagged_posts_count
posts_flagged_count = PostAction.joins(post: :topic) posts_flagged_count = PostAction.joins(post: :topic)
.where('post_actions.post_action_type_id' => PostActionType.FlagTypes, .where('post_actions.post_action_type_id' => PostActionType.FlagTypes,
'posts.deleted_at' => nil, 'posts.deleted_at' => nil,
'topics.deleted_at' => nil).count('DISTINCT posts.id') 'topics.deleted_at' => nil).count('DISTINCT posts.id')
@ -85,7 +85,7 @@ class PostAction < ActiveRecord::Base
if action = self.where(post_id: post.id, user_id: user.id, post_action_type_id: post_action_type_id).first if action = self.where(post_id: post.id, user_id: user.id, post_action_type_id: post_action_type_id).first
action.destroy action.destroy
action.deleted_at = Time.now action.deleted_at = Time.now
action.run_callbacks(:save) action.run_callbacks(:save)
end end
end end
@ -127,9 +127,9 @@ class PostAction < ActiveRecord::Base
end end
before_create do before_create do
raise AlreadyFlagged if is_flag? and PostAction.where(user_id: user_id, raise AlreadyFlagged if is_flag? and PostAction.where(user_id: user_id,
post_id: post_id, post_id: post_id,
post_action_type_id: PostActionType.FlagTypes).exists? post_action_type_id: PostActionType.FlagTypes).exists?
end end
after_save do after_save do
@ -167,8 +167,8 @@ class PostAction < ActiveRecord::Base
# inform user # inform user
if self.post.user if self.post.user
SystemMessage.create(self.post.user, :post_hidden, SystemMessage.create(self.post.user, :post_hidden,
url: self.post.url, url: self.post.url,
edit_delay: SiteSetting.cooldown_minutes_after_hiding_posts) edit_delay: SiteSetting.cooldown_minutes_after_hiding_posts)
end end
end end

View file

@ -42,7 +42,7 @@ class PostTiming < ActiveRecord::Base
def self.process_timings(current_user, topic_id, highest_seen, topic_time, timings) def self.process_timings(current_user, topic_id, highest_seen, topic_time, timings)
current_user.update_time_read! current_user.update_time_read!
original_unread = current_user.unread_notifications_by_type original_unread = current_user.unread_notifications_by_type
timings.each do |post_number, time| timings.each do |post_number, time|
if post_number >= 0 if post_number >= 0
@ -57,7 +57,7 @@ class PostTiming < ActiveRecord::Base
if timings.length > 0 if timings.length > 0
total_changed = Notification.mark_posts_read(current_user, topic_id, timings.map{|t| t[0]}) total_changed = Notification.mark_posts_read(current_user, topic_id, timings.map{|t| t[0]})
end end
TopicUser.update_last_read(current_user, topic_id, highest_seen, topic_time) TopicUser.update_last_read(current_user, topic_id, highest_seen, topic_time)
if total_changed > 0 if total_changed > 0

View file

@ -70,7 +70,7 @@ class Topic < ActiveRecord::Base
before_validation do before_validation do
if self.title.present? if self.title.present?
self.title = sanitize(self.title) self.title = sanitize(self.title)
self.title.strip! self.title.strip!
end end
end end
@ -119,7 +119,7 @@ class Topic < ActiveRecord::Base
errors.add(:title, I18n.t(:has_already_been_used)) if finder.exists? errors.add(:title, I18n.t(:has_already_been_used)) if finder.exists?
end end
def fancy_title def fancy_title
return title unless SiteSetting.title_fancy_entities? return title unless SiteSetting.title_fancy_entities?
# We don't always have to require this, if fancy is disabled # We don't always have to require this, if fancy is disabled
@ -132,7 +132,7 @@ class Topic < ActiveRecord::Base
# We don't care about quality on private messages # We don't care about quality on private messages
return if private_message? return if private_message?
sentinel = TextSentinel.title_sentinel(title) sentinel = TextSentinel.title_sentinel(title)
if sentinel.valid? if sentinel.valid?
# It's possible the sentinel has cleaned up the title a bit # It's possible the sentinel has cleaned up the title a bit
self.title = sentinel.text self.title = sentinel.text
@ -179,11 +179,11 @@ class Topic < ActiveRecord::Base
def self.visible def self.visible
where(visible: true) where(visible: true)
end end
def self.created_since(time_ago) def self.created_since(time_ago)
where("created_at > ?", time_ago) where("created_at > ?", time_ago)
end end
def private_message? def private_message?
self.archetype == Archetype.private_message self.archetype == Archetype.private_message
end end

View file

@ -18,7 +18,7 @@ class TopicUser < ActiveRecord::Base
end end
def self.auto_track(user_id, topic_id, reason) def self.auto_track(user_id, topic_id, reason)
if TopicUser.where(user_id: user_id, topic_id: topic_id, notifications_reason_id: nil).exists? if TopicUser.where(user_id: user_id, topic_id: topic_id, notifications_reason_id: nil).exists?
self.change(user_id, topic_id, self.change(user_id, topic_id,
notification_level: NotificationLevel::TRACKING, notification_level: NotificationLevel::TRACKING,
notifications_reason_id: reason notifications_reason_id: reason

View file

@ -46,7 +46,7 @@ class User < ActiveRecord::Base
attr_accessor :notification_channel_position attr_accessor :notification_channel_position
module NewTopicDuration module NewTopicDuration
ALWAYS = -1 ALWAYS = -1
LAST_VISIT = -2 LAST_VISIT = -2
end end
@ -57,7 +57,7 @@ class User < ActiveRecord::Base
def self.suggest_username(name) def self.suggest_username(name)
return nil unless name.present? return nil unless name.present?
# If it's an email # If it's an email
if name =~ /([^@]+)@([^\.]+)/ if name =~ /([^@]+)@([^\.]+)/
name = Regexp.last_match[1] name = Regexp.last_match[1]
@ -433,20 +433,20 @@ class User < ActiveRecord::Base
end end
def treat_as_new_topic_start_date def treat_as_new_topic_start_date
duration = new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes duration = new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes
case duration case duration
when User::NewTopicDuration::ALWAYS when User::NewTopicDuration::ALWAYS
created_at created_at
when User::NewTopicDuration::LAST_VISIT when User::NewTopicDuration::LAST_VISIT
previous_visit_at || created_at previous_visit_at || created_at
else else
duration.minutes.ago duration.minutes.ago
end end
end end
MAX_TIME_READ_DIFF = 100 MAX_TIME_READ_DIFF = 100
# attempt to add total read time to user based on previous time this was called # attempt to add total read time to user based on previous time this was called
def update_time_read! def update_time_read!
last_seen_key = "user-last-seen:#{id}" last_seen_key = "user-last-seen:#{id}"
last_seen = $redis.get(last_seen_key) last_seen = $redis.get(last_seen_key)
if last_seen.present? if last_seen.present?

View file

@ -48,7 +48,7 @@ class UserAction < ActiveRecord::Base
unless guardian.can_see_private_messages?(user_id) unless guardian.can_see_private_messages?(user_id)
results = results.where('topics.archetype <> ?', Archetype::private_message) results = results.where('topics.archetype <> ?', Archetype::private_message)
end end
unless guardian.user && guardian.user.id == user_id unless guardian.user && guardian.user.id == user_id
results = results.where("action_type <> ?", BOOKMARK) results = results.where("action_type <> ?", BOOKMARK)
end end
@ -76,16 +76,16 @@ class UserAction < ActiveRecord::Base
guardian = opts[:guardian] guardian = opts[:guardian]
ignore_private_messages = opts[:ignore_private_messages] ignore_private_messages = opts[:ignore_private_messages]
# The weird thing is that target_post_id can be null, so it makes everything # The weird thing is that target_post_id can be null, so it makes everything
# ever so more complex. Should we allow this, not sure. # ever so more complex. Should we allow this, not sure.
builder = SqlBuilder.new(" builder = SqlBuilder.new("
SELECT SELECT
t.title, a.action_type, a.created_at, t.id topic_id, t.title, a.action_type, a.created_at, t.id topic_id,
coalesce(p.post_number, 1) post_number, coalesce(p.post_number, 1) post_number,
p.reply_to_post_number, p.reply_to_post_number,
pu.email ,pu.username, pu.name, pu.id user_id, pu.email ,pu.username, pu.name, pu.id user_id,
u.email acting_email, u.username acting_username, u.name acting_name, u.id acting_user_id, u.email acting_email, u.username acting_username, u.name acting_name, u.id acting_user_id,
coalesce(p.cooked, p2.cooked) cooked coalesce(p.cooked, p2.cooked) cooked
FROM user_actions as a FROM user_actions as a
JOIN topics t on t.id = a.target_topic_id JOIN topics t on t.id = a.target_topic_id
@ -102,7 +102,7 @@ JOIN users pu on pu.id = COALESCE(p.user_id, t.user_id)
unless guardian.can_see_deleted_posts? unless guardian.can_see_deleted_posts?
builder.where("p.deleted_at is null and p2.deleted_at is null") builder.where("p.deleted_at is null and p2.deleted_at is null")
end end
unless guardian.user && guardian.user.id == user_id unless guardian.user && guardian.user.id == user_id
builder.where("a.action_type not in (#{BOOKMARK})") builder.where("a.action_type not in (#{BOOKMARK})")
end end

View file

@ -2,17 +2,17 @@ class UserSearch
def self.search term, topic_id = nil def self.search term, topic_id = nil
sql = User.sql_builder( sql = User.sql_builder(
"select id, username, name, email from users u "select id, username, name, email from users u
/*left_join*/ /*left_join*/
/*where*/ /*where*/
/*order_by*/") /*order_by*/")
if topic_id if topic_id
sql.left_join "(select distinct p.user_id from posts p where topic_id = :topic_id) s on s.user_id = u.id", topic_id: topic_id sql.left_join "(select distinct p.user_id from posts p where topic_id = :topic_id) s on s.user_id = u.id", topic_id: topic_id
end end
if term.present? if term.present?
sql.where("username_lower like :term_like or sql.where("username_lower like :term_like or
to_tsvector('simple', name) @@ to_tsvector('simple', name) @@
to_tsquery('simple', to_tsquery('simple',
@ -25,7 +25,7 @@ class UserSearch
sql.order_by "case when username_lower = :term then 0 else 1 end asc" sql.order_by "case when username_lower = :term then 0 else 1 end asc"
end end
if topic_id if topic_id
sql.order_by "case when s.user_id is null then 0 else 1 end desc" sql.order_by "case when s.user_id is null then 0 else 1 end desc"
end end

View file

@ -3,19 +3,19 @@ require_dependency 'age_words'
class BasicTopicSerializer < ApplicationSerializer class BasicTopicSerializer < ApplicationSerializer
include ActionView::Helpers include ActionView::Helpers
attributes :id, attributes :id,
:title, :title,
:fancy_title, :fancy_title,
:reply_count, :reply_count,
:posts_count, :posts_count,
:highest_post_number, :highest_post_number,
:image_url, :image_url,
:created_at, :created_at,
:last_posted_at, :last_posted_at,
:age, :age,
:unseen, :unseen,
:last_read_post_number, :last_read_post_number,
:unread, :unread,
:new_posts :new_posts
def age def age

View file

@ -1,9 +1,9 @@
class CategorySerializer < ApplicationSerializer class CategorySerializer < ApplicationSerializer
attributes :id, attributes :id,
:name, :name,
:color, :color,
:slug, :slug,
:topic_count, :topic_count,
:description, :description,
:topic_url :topic_url

View file

@ -1,9 +1,9 @@
class CategoryTopicSerializer < BasicTopicSerializer class CategoryTopicSerializer < BasicTopicSerializer
attributes :slug, attributes :slug,
:visible, :visible,
:pinned, :pinned,
:closed, :closed,
:archived :archived
has_one :category has_one :category

View file

@ -1,10 +1,10 @@
class CurrentUserSerializer < BasicUserSerializer class CurrentUserSerializer < BasicUserSerializer
attributes :name, attributes :name,
:unread_notifications, :unread_notifications,
:unread_private_messages, :unread_private_messages,
:admin?, :admin?,
:notification_channel_position, :notification_channel_position,
:site_flagged_posts_count, :site_flagged_posts_count,
:moderator?, :moderator?,
:reply_count, :reply_count,

View file

@ -1,6 +1,6 @@
class SiteSerializer < ApplicationSerializer class SiteSerializer < ApplicationSerializer
attributes :default_archetype, attributes :default_archetype,
:notification_types, :notification_types,
:post_types :post_types
@ -17,5 +17,5 @@ class SiteSerializer < ApplicationSerializer
def post_types def post_types
{regular: Post::REGULAR, moderator_action: Post::MODERATOR_ACTION} {regular: Post::REGULAR, moderator_action: Post::MODERATOR_ACTION}
end end
end end

View file

@ -1,11 +1,11 @@
class TopicLinkSerializer < ApplicationSerializer class TopicLinkSerializer < ApplicationSerializer
attributes :url, attributes :url,
:title, :title,
:fancy_title, :fancy_title,
:internal, :internal,
:reflection, :reflection,
:clicks, :clicks,
:user_id :user_id
def url def url

View file

@ -1,15 +1,15 @@
class TopicListItemSerializer < BasicTopicSerializer class TopicListItemSerializer < BasicTopicSerializer
attributes :views, attributes :views,
:like_count, :like_count,
:visible, :visible,
:pinned, :pinned,
:closed, :closed,
:archived, :archived,
:last_post_age, :last_post_age,
:starred, :starred,
:has_best_of, :has_best_of,
:archetype, :archetype,
:slug :slug
has_one :category has_one :category

View file

@ -49,7 +49,7 @@ class UserSerializer < BasicUserSerializer
def auto_track_topics_after_msecs def auto_track_topics_after_msecs
object.auto_track_topics_after_msecs || SiteSetting.auto_track_topics_after object.auto_track_topics_after_msecs || SiteSetting.auto_track_topics_after
end end
def new_topic_duration_minutes def new_topic_duration_minutes
object.new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes object.new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes
end end

View file

@ -8,7 +8,7 @@
}; };
var assetPath = function(asset){ var assetPath = function(asset){
return map[asset]; return map[asset];
}; };
return assetPath; return assetPath;
@ -20,7 +20,7 @@
<%= javascript_include_tag "application" %> <%= javascript_include_tag "application" %>
<%-end%> <%-end%>
<%- Rack::MiniProfiler.step "admin" do %> <%- Rack::MiniProfiler.step "admin" do %>
<%= javascript_include_tag "admin"%> <%= javascript_include_tag "admin"%>
<%-end%> <%-end%>
<%- else %> <%- else %>

View file

@ -1,12 +1,12 @@
<%- unless SiteCustomization.override_default_style(session[:preview_style]) %> <%- unless SiteCustomization.override_default_style(session[:preview_style]) %>
<%=stylesheet_link_tag "application"%> <%=stylesheet_link_tag "application"%>
<%- end %> <%- end %>
<%- if mini_profiler_enabled? %> <%- if mini_profiler_enabled? %>
<%- Rack::MiniProfiler.step "stylsheet" do%> <%- Rack::MiniProfiler.step "stylsheet" do%>
<%= stylesheet_link_tag "admin"%> <%= stylesheet_link_tag "admin"%>
<%-end%> <%-end%>
<%- elsif admin? %> <%- elsif admin? %>
<%= stylesheet_link_tag "admin"%> <%= stylesheet_link_tag "admin"%>
<%-end%> <%-end%>
<%=SiteCustomization.custom_stylesheet(session[:preview_style])%> <%=SiteCustomization.custom_stylesheet(session[:preview_style])%>

View file

@ -1,12 +1,12 @@
<%# <%#
The fonts are loaded outside of the stylesheet so that we can dynamically change The fonts are loaded outside of the stylesheet so that we can dynamically change
the path. This is to get around CDN caching on the Origin: the path. This is to get around CDN caching on the Origin:
https://forums.aws.amazon.com/thread.jspa?threadID=114646 https://forums.aws.amazon.com/thread.jspa?threadID=114646
%> %>
<% font_domain = "#{request.protocol}#{request.host_with_port}" %> <% font_domain = "#{request.protocol}#{request.host_with_port}" %>
<style> <style>
@font-face { @font-face {
@ -27,5 +27,5 @@
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
</style> </style>

View file

@ -9,7 +9,7 @@
<%= form_tag(email_resubscribe_path(key: params[:key])) do %> <%= form_tag(email_resubscribe_path(key: params[:key])) do %>
<%= submit_tag t(:'resubscribe.action'), class: 'btn btn-danger' %> <%= submit_tag t(:'resubscribe.action'), class: 'btn btn-danger' %>
<% end %> <% end %>
<%- else %> <%- else %>
<h2><%= t :'unsubscribed.not_found' %></h2> <h2><%= t :'unsubscribed.not_found' %></h2>
<p><%= t :'unsubscribed.not_found_description' %></p> <p><%= t :'unsubscribed.not_found_description' %></p>

View file

@ -32,7 +32,7 @@
<div class="row"> <div class="row">
<div class="title span13"> <div class="title span13">
<a href="/"><img src="<%=SiteSetting.logo_url%>" alt="<%=SiteSetting.title%>" id="site-logo"></a> <a href="/"><img src="<%=SiteSetting.logo_url%>" alt="<%=SiteSetting.title%>" id="site-logo"></a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -48,11 +48,11 @@
<%- @preloaded.each do |key, json| %> <%- @preloaded.each do |key, json| %>
PreloadStore.store("<%= key %>", <%= raw json %>) PreloadStore.store("<%= key %>", <%= raw json %>)
<% end %> <% end %>
</script> </script>
<%- end %> <%- end %>
<%= yield :data %> <%= yield :data %>
<footer id='bottom'></footer> <footer id='bottom'></footer>
<%= render :partial => "common/discourse_javascript" %> <%= render :partial => "common/discourse_javascript" %>

View file

@ -9,19 +9,19 @@
<link rel="icon" type="image/png" href=<%=SiteSetting.favicon_url%>> <link rel="icon" type="image/png" href=<%=SiteSetting.favicon_url%>>
<%- if mini_profiler_enabled? %> <%- if mini_profiler_enabled? %>
<%- Rack::MiniProfiler.step "stylsheet" do%> <%- Rack::MiniProfiler.step "stylsheet" do%>
<%=stylesheet_link_tag "application"%> <%=stylesheet_link_tag "application"%>
<%- end %> <%- end %>
<%- if current_user.try(:admin) %> <%- if current_user.try(:admin) %>
<%- Rack::MiniProfiler.step "stylsheet" do%> <%- Rack::MiniProfiler.step "stylsheet" do%>
<%= stylesheet_link_tag "admin"%> <%= stylesheet_link_tag "admin"%>
<%-end%> <%-end%>
<%- end %> <%- end %>
<%- else %> <%- else %>
<%=stylesheet_link_tag "application"%> <%=stylesheet_link_tag "application"%>
<%- if current_user.try(:admin) %> <%- if current_user.try(:admin) %>
<%= stylesheet_link_tag "admin"%> <%= stylesheet_link_tag "admin"%>
<%- end %> <%- end %>
<%- end %> <%- end %>
@ -37,7 +37,7 @@
<div class="row"> <div class="row">
<div class="title span13"> <div class="title span13">
<a href="/"><img src="<%=SiteSetting.logo_url%>" alt="<%=SiteSetting.title%>" id="site-logo"></a> <a href="/"><img src="<%=SiteSetting.logo_url%>" alt="<%=SiteSetting.title%>" id="site-logo"></a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,5 +1,5 @@
<%- site_link = raw(@markdown_linker.create(@site_name, '/')) %> <%- site_link = raw(@markdown_linker.create(@site_name, '/')) %>
<%= raw(t 'user_notifications.digest.why', <%= raw(t 'user_notifications.digest.why',
site_link: site_link, site_link: site_link,
last_seen_at: @last_seen_at) %> last_seen_at: @last_seen_at) %>

View file

@ -2,7 +2,7 @@
<%if flash[:error]%> <%if flash[:error]%>
<div class='alert alert-error'> <div class='alert alert-error'>
<%=flash[:error]%> <%=flash[:error]%>
</div> </div>
<%else%> <%else%>
<h2><%= t 'activation.welcome_to', site_name: SiteSetting.title %></h2> <h2><%= t 'activation.welcome_to', site_name: SiteSetting.title %></h2>
@ -13,7 +13,7 @@
<%= raw t('activation.please_continue', link: link_to(SiteSetting.title, root_path)) %></a>. <%= raw t('activation.please_continue', link: link_to(SiteSetting.title, root_path)) %></a>.
<% end %> <% end %>
</p> </p>
<%end%> <%end%>
</div> </div>

View file

@ -1,7 +1,7 @@
<div id="simple-container"> <div id="simple-container">
<%if flash[:error]%> <%if flash[:error]%>
<div class='alert alert-error'> <div class='alert alert-error'>
<%=flash[:error]%> <%=flash[:error]%>
</div> </div>
<%else%> <%else%>
<h2><%= t 'change_email.confirmed' %></h2> <h2><%= t 'change_email.confirmed' %></h2>
@ -9,4 +9,4 @@
<%= raw t('change_email.please_continue', link: link_to(SiteSetting.title, root_path)) %> <%= raw t('change_email.please_continue', link: link_to(SiteSetting.title, root_path)) %>
</p> </p>
<%end%> <%end%>
</div> </div>

View file

@ -1,7 +1,7 @@
<div id="simple-container"> <div id="simple-container">
<%if flash[:error]%> <%if flash[:error]%>
<div class='alert alert-error'> <div class='alert alert-error'>
<%=flash[:error]%> <%=flash[:error]%>
</div> </div>
<%end%> <%end%>
<% if @user.present? and @user.errors.any? %> <% if @user.present? and @user.errors.any? %>
@ -14,7 +14,7 @@
<%if flash[:success]%> <%if flash[:success]%>
<div class='alert alert-success'> <div class='alert alert-success'>
<%=flash[:success]%> <%=flash[:success]%>
</div> </div>
<p> <p>
<%- if @requires_approval %> <%- if @requires_approval %>
@ -22,8 +22,8 @@
<% else %> <% else %>
<%= raw t 'activation.please_continue', link: link_to(SiteSetting.title, root_path) %> <%= raw t 'activation.please_continue', link: link_to(SiteSetting.title, root_path) %>
<% end %> <% end %>
</p> </p>
<% else %> <% else %>
<%if @user.present? %> <%if @user.present? %>

View file

@ -101,13 +101,13 @@ ExTreshold: 4
# Experimental feature for apt-listbugs: pass-through SOAP requests and # Experimental feature for apt-listbugs: pass-through SOAP requests and
# responses to/from bugs.debian.org. If not set, default is true if # responses to/from bugs.debian.org. If not set, default is true if
# ForceManaged is enabled and false otherwise. # ForceManaged is enabled and false otherwise.
# ForwardBtsSoap: 1 # ForwardBtsSoap: 1
# The daemon has a small cache for DNS data, to speed up resolution. The # The daemon has a small cache for DNS data, to speed up resolution. The
# expiration time of the DNS entries can be configured in seconds. # expiration time of the DNS entries can be configured in seconds.
# DnsCacheSeconds: 3600 # DnsCacheSeconds: 3600
# Don't touch the following values without good consideration! # Don't touch the following values without good consideration!
# #
# Max. count of connection threads kept ready (for faster response in the # Max. count of connection threads kept ready (for faster response in the
# future). Should be a sane value between 0 and average number of connections, # future). Should be a sane value between 0 and average number of connections,
@ -196,7 +196,7 @@ ExTreshold: 4
# #
# #
# It's possible to use use apt-cacher-ng as a regular web server with limited # It's possible to use use apt-cacher-ng as a regular web server with limited
# feature set, i.e. # feature set, i.e.
# including directory browsing and download of any file; # including directory browsing and download of any file;
# excluding sorting, mime types/encodings, CGI execution, index page # excluding sorting, mime types/encodings, CGI execution, index page
# redirection and other funny things. # redirection and other funny things.
@ -213,13 +213,13 @@ ExTreshold: 4
# Precache a set of files referenced by specified index files. This can be used # Precache a set of files referenced by specified index files. This can be used
# to create a partial mirror usable for offline work. There are certain limits # to create a partial mirror usable for offline work. There are certain limits
# and restrictions on the path specification, see manual for details. A list of # and restrictions on the path specification, see manual for details. A list of
# (maybe) relevant index files could be retrieved via # (maybe) relevant index files could be retrieved via
# "apt-get --print-uris update" on a client machine. # "apt-get --print-uris update" on a client machine.
# #
# PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages* # PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages*
# Arbitrary set of data to append to request headers sent over the wire. Should # Arbitrary set of data to append to request headers sent over the wire. Should
# be a well formated HTTP headers part including newlines (DOS style) which # be a well formated HTTP headers part including newlines (DOS style) which
# can be entered as escape sequences (\r\n). # can be entered as escape sequences (\r\n).
# RequestAppendix: X-Tracking-Choice: do-not-track\r\n # RequestAppendix: X-Tracking-Choice: do-not-track\r\n
@ -273,4 +273,4 @@ ExTreshold: 4
# follow per request, 0 disables the internal redirection. If not set, # follow per request, 0 disables the internal redirection. If not set,
# default value is 0 if ForceManaged is used and 5 otherwise. # default value is 0 if ForceManaged is used and 5 otherwise.
# #
# RedirMax: 5 # RedirMax: 5

View file

@ -8,7 +8,7 @@ development:
<<: *defaults <<: *defaults
test: test:
<<: *defaults <<: *defaults
db: 1 db: 1
staging: staging:

View file

@ -84,7 +84,7 @@ when 'deb'
if(pkgs_avail) if(pkgs_avail)
path_name = pkgs_avail.find_all{ |path| path_name = pkgs_avail.find_all{ |path|
ver = node[:omnibus_updater][:version] || '.' ver = node[:omnibus_updater][:version] || '.'
path.include?('.deb') && path.include?(platform_name) && path.include?('.deb') && path.include?(platform_name) &&
path.include?(platform_version) && path.include?(node.kernel.machine) && path.include?(platform_version) && path.include?(node.kernel.machine) &&
path.include?(ver) path.include?(ver)
}.sort.last }.sort.last
@ -104,7 +104,7 @@ when 'rpm'
if(pkgs_avail) if(pkgs_avail)
path_name = pkgs_avail.find_all{ |path| path_name = pkgs_avail.find_all{ |path|
ver = node[:omnibus_updater][:version] || '.' ver = node[:omnibus_updater][:version] || '.'
path.include?('.rpm') && path.include?(platform_name) && path.include?('.rpm') && path.include?(platform_name) &&
path.include?(platform_version) && path.include?(node.kernel.machine) && path.include?(platform_version) && path.include?(node.kernel.machine) &&
path.include?(ver) path.include?(ver)
}.sort.last }.sort.last

View file

@ -30,15 +30,15 @@ module Discourse
config.assets.paths += %W(#{config.root}/config/locales) config.assets.paths += %W(#{config.root}/config/locales)
config.assets.precompile += [ config.assets.precompile += [
'admin.js', 'admin.css', 'shiny/shiny.css', 'preload_store.js', 'admin.js', 'admin.css', 'shiny/shiny.css', 'preload_store.js',
'jquery.js', 'defer/html-sanitizer-bundle.js', 'defer/fastclick.js' 'jquery.js', 'defer/html-sanitizer-bundle.js', 'defer/fastclick.js'
] ]
# Activate observers that should always be running. # Activate observers that should always be running.
config.active_record.observers = [ config.active_record.observers = [
:user_email_observer, :user_email_observer,
:user_action_observer, :user_action_observer,
:message_bus_observer, :message_bus_observer,
:post_alert_observer, :post_alert_observer,
:search_observer :search_observer
] ]
@ -66,10 +66,10 @@ module Discourse
# We need to be able to spin threads # We need to be able to spin threads
config.active_record.thread_safe! config.active_record.thread_safe!
# see: http://stackoverflow.com/questions/11894180/how-does-one-correctly-add-custom-sql-dml-in-migrations/11894420#11894420 # see: http://stackoverflow.com/questions/11894180/how-does-one-correctly-add-custom-sql-dml-in-migrations/11894420#11894420
config.active_record.schema_format = :sql config.active_record.schema_format = :sql
# per https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet # per https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
config.pbkdf2_iterations = 64000 config.pbkdf2_iterations = 64000
# dumping rack lock cause the message bus does not work with it (throw :async, it catches Exception) # dumping rack lock cause the message bus does not work with it (throw :async, it catches Exception)
@ -93,7 +93,7 @@ module Discourse
config.action_dispatch.rack_cache = nil config.action_dispatch.rack_cache = nil
# So open id logs somewhere sane # So open id logs somewhere sane
config.after_initialize do config.after_initialize do
OpenID::Util.logger = Rails.logger OpenID::Util.logger = Rails.logger
end end
end end

View file

@ -2,7 +2,7 @@ require 'clockwork'
require_relative 'boot' require_relative 'boot'
require_relative 'environment' require_relative 'environment'
# These are jobs you should run on a regular basis to make your # These are jobs you should run on a regular basis to make your
# forum work properly. # forum work properly.
module Clockwork module Clockwork

View file

@ -26,15 +26,15 @@ Discourse::Application.configure do
config.assets.debug = true config.assets.debug = true
config.watchable_dirs['lib'] = [:rb] config.watchable_dirs['lib'] = [:rb]
config.sass.debug_info = false config.sass.debug_info = false
config.ember.variant = :development config.ember.variant = :development
config.ember.handlebars_location = "#{Rails.root}/app/assets/javascripts/external/handlebars-1.0.rc.3.js" config.ember.handlebars_location = "#{Rails.root}/app/assets/javascripts/external/handlebars-1.0.rc.3.js"
config.ember.ember_location = "#{Rails.root}/app/assets/javascripts/external/ember.js" config.ember.ember_location = "#{Rails.root}/app/assets/javascripts/external/ember.js"
config.handlebars.precompile = false config.handlebars.precompile = false
# a bit hacky but works # a bit hacky but works
config.after_initialize do config.after_initialize do
config.middleware.delete Airbrake::UserInformer config.middleware.delete Airbrake::UserInformer
config.middleware.delete Airbrake::Rack config.middleware.delete Airbrake::Rack
end end

View file

@ -16,7 +16,7 @@ Discourse::Application.configure do
# stuff should be pre-compiled # stuff should be pre-compiled
config.assets.compile = false config.assets.compile = false
# Generate digests for assets URLs # Generate digests for assets URLs
config.assets.digest = true config.assets.digest = true

View file

@ -38,7 +38,7 @@ Discourse::Application.configure do
# Print deprecation notices to the stderr # Print deprecation notices to the stderr
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
# lower iteration count for test # lower iteration count for test
config.pbkdf2_iterations = 10 config.pbkdf2_iterations = 10
config.ember.variant = :development config.ember.variant = :development

View file

@ -1,4 +1,4 @@
MessageBus.site_id_lookup do MessageBus.site_id_lookup do
RailsMultisite::ConnectionManagement.current_db RailsMultisite::ConnectionManagement.current_db
end end
@ -21,7 +21,7 @@ MessageBus.redis_config = YAML::load(File.open("#{Rails.root}/config/redis.yml")
MessageBus.long_polling_enabled = SiteSetting.enable_long_polling MessageBus.long_polling_enabled = SiteSetting.enable_long_polling
MessageBus.long_polling_interval = SiteSetting.long_polling_interval MessageBus.long_polling_interval = SiteSetting.long_polling_interval
MessageBus.is_admin_lookup do |env| MessageBus.is_admin_lookup do |env|
user = CurrentUser.lookup_from_env(env) user = CurrentUser.lookup_from_env(env)
if user && user.admin if user && user.admin
true true

View file

@ -5,14 +5,14 @@ if defined?(Rack::MiniProfiler)
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore
# For our app, let's just show mini profiler always, polling is chatty so nuke that # For our app, let's just show mini profiler always, polling is chatty so nuke that
Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env| Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env|
(env['HTTP_USER_AGENT'] !~ /iPad|iPhone|Nexus 7/) and (env['HTTP_USER_AGENT'] !~ /iPad|iPhone|Nexus 7/) and
(env['PATH_INFO'] !~ /^\/message-bus/) and (env['PATH_INFO'] !~ /^\/message-bus/) and
(env['PATH_INFO'] !~ /topics\/timings/) and (env['PATH_INFO'] !~ /topics\/timings/) and
(env['PATH_INFO'] !~ /assets/) and (env['PATH_INFO'] !~ /assets/) and
(env['PATH_INFO'] !~ /jasmine/) and (env['PATH_INFO'] !~ /jasmine/) and
(env['PATH_INFO'] !~ /users\/.*\/avatar/) and (env['PATH_INFO'] !~ /users\/.*\/avatar/) and
(env['PATH_INFO'] !~ /srv\/status/) (env['PATH_INFO'] !~ /srv\/status/)
end end
Rack::MiniProfiler.config.position = 'left' Rack::MiniProfiler.config.position = 'left'
@ -24,8 +24,8 @@ if defined?(Rack::MiniProfiler)
# require "#{Rails.root}/vendor/backports/notification" # require "#{Rails.root}/vendor/backports/notification"
inst = Class.new inst = Class.new
class << inst class << inst
def start(name,id,payload) def start(name,id,payload)
if Rack::MiniProfiler.current and name !~ /(process_action.action_controller)|(render_template.action_view)/ if Rack::MiniProfiler.current and name !~ /(process_action.action_controller)|(render_template.action_view)/
@prf ||= {} @prf ||= {}

View file

@ -4,7 +4,7 @@ Rails::Rack::Logger.class_eval do
previous_level = Rails.logger.level previous_level = Rails.logger.level
if (env['PATH_INFO'].index("/assets/") == 0) or if (env['PATH_INFO'].index("/assets/") == 0) or
(env['PATH_INFO'].index("mini-profiler-resources") == 0) (env['PATH_INFO'].index("mini-profiler-resources") == 0)
Rails.logger.level = Logger::ERROR Rails.logger.level = Logger::ERROR
end end
call_without_quiet_assets(env).tap do call_without_quiet_assets(env).tap do
@ -12,4 +12,4 @@ Rails::Rack::Logger.class_eval do
end end
end end
alias_method_chain :call, :quiet_assets alias_method_chain :call, :quiet_assets
end end

View file

@ -1,18 +1,18 @@
# Definitely change this when you deploy to production. Ours is replaced by jenkins. # Definitely change this when you deploy to production. Ours is replaced by jenkins.
# This token is used to secure sessions, we don't mind shipping with one to ease test and debug, # This token is used to secure sessions, we don't mind shipping with one to ease test and debug,
# however, the stock one should never be used in production, people will be able to crack # however, the stock one should never be used in production, people will be able to crack
# session cookies. # session cookies.
# #
# Generate a new secret with "rake secret". Copy the output of that command and paste it # Generate a new secret with "rake secret". Copy the output of that command and paste it
# in your secret_token.rb as the value of Discourse::Application.config.secret_token: # in your secret_token.rb as the value of Discourse::Application.config.secret_token:
# #
# Discourse::Application.config.secret_token = "SET_SECRET_HERE" # Discourse::Application.config.secret_token = "SET_SECRET_HERE"
# delete all lines below in production # delete all lines below in production
if Rails.env.test? || Rails.env.development? if Rails.env.test? || Rails.env.development?
Discourse::Application.config.secret_token = "47f5390004bf6d25bb97083fb98e7cc133ab450ba814dd19638a78282b4ca291" Discourse::Application.config.secret_token = "47f5390004bf6d25bb97083fb98e7cc133ab450ba814dd19638a78282b4ca291"
else else
raise "You must set a secret token in config/initializers/secret_token.rb" raise "You must set a secret token in config/initializers/secret_token.rb"
end end

View file

@ -3,8 +3,8 @@ class SilenceLogger < Rails::Rack::Logger
@app = app @app = app
@opts = opts @opts = opts
@opts[:silenced] ||= [] @opts[:silenced] ||= []
# Rails introduces something called taggers in the Logger, needs to be initialized # Rails introduces something called taggers in the Logger, needs to be initialized
super(app) super(app)
end end

View file

@ -1,5 +1,3 @@
RailsMultisite::ConnectionManagement.each_connection do
RailsMultisite::ConnectionManagement.each_connection do
SiteSetting.refresh! SiteSetting.refresh!
end end

View file

@ -1,4 +1,4 @@
# this is a trivial graceful restart on touch of tmp/restart. # this is a trivial graceful restart on touch of tmp/restart.
# #
# It simply drains all the requests (waits up to 4 seconds) and issues a HUP # It simply drains all the requests (waits up to 4 seconds) and issues a HUP
# if you need a more sophisticated cycling restart for multiple thins it will need to be written # if you need a more sophisticated cycling restart for multiple thins it will need to be written
@ -6,13 +6,13 @@
# This works fine for Discourse.org cause we host our app accross multiple machines, if you hosting # This works fine for Discourse.org cause we host our app accross multiple machines, if you hosting
# on a single machine you have a trickier problem at hand as you need to cycle the processes in order # on a single machine you have a trickier problem at hand as you need to cycle the processes in order
Thread.new do Thread.new do
file = "#{Rails.root}/tmp/restart" file = "#{Rails.root}/tmp/restart"
old_time = File.ctime(file).to_i if File.exists? file old_time = File.ctime(file).to_i if File.exists? file
wait_seconds = 4 wait_seconds = 4
return if $PROGRAM_NAME !~ /thin/ return if $PROGRAM_NAME !~ /thin/
while true while true
time = File.ctime(file).to_i if File.exists? file time = File.ctime(file).to_i if File.exists? file
@ -20,8 +20,8 @@ Thread.new do
Rails.logger.info "attempting to reload #{$$} #{$PROGRAM_NAME} in #{wait_seconds} seconds" Rails.logger.info "attempting to reload #{$$} #{$PROGRAM_NAME} in #{wait_seconds} seconds"
$shutdown = true $shutdown = true
sleep wait_seconds sleep wait_seconds
Rails.logger.info "restarting #{$$}" Rails.logger.info "restarting #{$$}"
Process.kill("HUP", $$) Process.kill("HUP", $$)
return return
end end

View file

@ -1,7 +1,7 @@
--- ---
nl: nl:
js: ~ js: ~
share: share:
? "0" ? "0"
: "Je negeert alle notificaties in dit topic." : "Je negeert alle notificaties in dit topic."
? "0_2" ? "0_2"

View file

@ -350,7 +350,7 @@ en:
body_min_entropy: "The minimum allowed entropy for post body" body_min_entropy: "The minimum allowed entropy for post body"
new_user_period_days: "How long a user is highlighted as being new, in days" new_user_period_days: "How long a user is highlighted as being new, in days"
title_fancy_entities: "Convert fancy HTML entities in topic titles" title_fancy_entities: "Convert fancy HTML entities in topic titles"
notification_types: notification_types:
mentioned: "%{display_username} mentioned you in %{link}" mentioned: "%{display_username} mentioned you in %{link}"
liked: "%{display_username} liked your post in %{link}" liked: "%{display_username} liked your post in %{link}"

View file

@ -66,7 +66,7 @@ nl:
trust_levels: trust_levels:
new: new:
title: "nieuwe gebruiker" title: "nieuwe gebruiker"
basic: basic:
title: "basisgebruiker" title: "basisgebruiker"
regular: regular:
title: "gemiddelde gebruiker" title: "gemiddelde gebruiker"
@ -91,7 +91,7 @@ nl:
datetime: datetime:
distance_in_words: distance_in_words:
half_a_minute: "< 1m" half_a_minute: "< 1m"
less_than_x_seconds: less_than_x_seconds:
one: "< 1s" one: "< 1s"
other: "< %{count}s" other: "< %{count}s"
@ -127,7 +127,7 @@ nl:
other: "%{count}j" other: "%{count}j"
distance_in_words_verbose: distance_in_words_verbose:
half_a_minute: "een halve minuut geleden" half_a_minute: "een halve minuut geleden"
less_than_x_seconds: less_than_x_seconds:
one: "nu" one: "nu"
other: "nu" other: "nu"
@ -182,7 +182,7 @@ nl:
approval_required: "Een moderator moet je nieuwe account handmatig goedkeuren voordat je toegang krijgt tot dit forum. Je krijgt een e-mail van ons wanneer je account is goedgekeurd!" approval_required: "Een moderator moet je nieuwe account handmatig goedkeuren voordat je toegang krijgt tot dit forum. Je krijgt een e-mail van ons wanneer je account is goedgekeurd!"
post_action_types: post_action_types:
off_topic: off_topic:
title: 'Off-Topic' title: 'Off-Topic'
description: 'Deze post wijkt erg af van het onderwerp van deze discussie, en moet wellicht naar een ander topic worden verplaatst.' description: 'Deze post wijkt erg af van het onderwerp van deze discussie, en moet wellicht naar een ander topic worden verplaatst.'
@ -213,7 +213,7 @@ nl:
user_must_edit: '<p>Gemelde inhoud verborgen.</p>' user_must_edit: '<p>Gemelde inhoud verborgen.</p>'
archetypes: archetypes:
regular: regular:
title: "Standaard-topic" title: "Standaard-topic"
unsubscribed: unsubscribed:
@ -346,7 +346,7 @@ nl:
new_user_period_days: "Hoe lang een gebruiker als nieuw wordt aangetoond, in dagen." new_user_period_days: "Hoe lang een gebruiker als nieuw wordt aangetoond, in dagen."
notification_types: notification_types:
mentioned: "%{display_username} heeft je genoemd in %{link}" mentioned: "%{display_username} heeft je genoemd in %{link}"
@ -362,13 +362,13 @@ nl:
# This section is exported to the javascript for i18n # This section is exported to the javascript for i18n
js: js:
search: search:
types: types:
category: 'Categorieën' category: 'Categorieën'
topic: 'Topics' topic: 'Topics'
user: 'Gebruikers' user: 'Gebruikers'
youve_posted: "Jij Hebt Dit Gepost" youve_posted: "Jij Hebt Dit Gepost"
original_poster: "Originele Poster" original_poster: "Originele Poster"
@ -402,7 +402,7 @@ nl:
edited: "bewerkte" edited: "bewerkte"
move_posts: move_posts:
moderator_post: moderator_post:
one: "Ik heb een post naar een nieuw topic verplaatst: %{topic_link}" one: "Ik heb een post naar een nieuw topic verplaatst: %{topic_link}"
other: "Ik heb %{count} posts naar een nieuw topic verplaatst: %{topic_link}" other: "Ik heb %{count} posts naar een nieuw topic verplaatst: %{topic_link}"
@ -416,7 +416,7 @@ nl:
visible_enabled: "Dit topic is nu zichtbaar; het zal weer worden weergegeven in topiclijsten." visible_enabled: "Dit topic is nu zichtbaar; het zal weer worden weergegeven in topiclijsten."
visible_disabled: "Dit topic is nu onzichtbaar; het zal niet worden weergegeven in topiclijsten, en kan alleen via een directe link worden bezocht." visible_disabled: "Dit topic is nu onzichtbaar; het zal niet worden weergegeven in topiclijsten, en kan alleen via een directe link worden bezocht."
login: login:
not_approved: "Je account is nog niet goedgekeurd. Je zal via de mail een bericht van ons ontvangen wanneer je klaar bent om in te kunnen loggen." not_approved: "Je account is nog niet goedgekeurd. Je zal via de mail een bericht van ons ontvangen wanneer je klaar bent om in te kunnen loggen."
incorrect_username_email_or_password: "Incorrecte gebruikersnaam, e-mailadres of wachtwoord" incorrect_username_email_or_password: "Incorrecte gebruikersnaam, e-mailadres of wachtwoord"
wait_approval: "Bedankt voor je inschrijving. We zullen het je laten weten als je account is goedgekeurd." wait_approval: "Bedankt voor je inschrijving. We zullen het je laten weten als je account is goedgekeurd."
@ -503,7 +503,7 @@ nl:
subject_template: "Bericht van %{site_name}: Je Post is verborgen wegens meldingen uit de site-gemeenschap" subject_template: "Bericht van %{site_name}: Je Post is verborgen wegens meldingen uit de site-gemeenschap"
text_body_template: | text_body_template: |
Hallo, Hallo,
Dit is een geautomatiseerd bericht van %{site_name} om je te laten weten dat de volgende post is verborgen naar aanleiding van meldingen binnen de site-gemeenschap. Dit is een geautomatiseerd bericht van %{site_name} om je te laten weten dat de volgende post is verborgen naar aanleiding van meldingen binnen de site-gemeenschap.
%{base_url}%{url} %{base_url}%{url}
@ -515,7 +515,7 @@ nl:
Je kan je post bewerken na %{edit_delay} minuten, en het zal automatisch weer zichtbaar worden. Dit verhoogt je forum vertrouwensniveau. Je kan je post bewerken na %{edit_delay} minuten, en het zal automatisch weer zichtbaar worden. Dit verhoogt je forum vertrouwensniveau.
Echter, als de post een tweede keer wordt verborgen door de site-gemeenschap, wordt er een moderator ingelicht. Echter, als de post een tweede keer wordt verborgen door de site-gemeenschap, wordt er een moderator ingelicht.
Zij kunnen verdere actie ondernemen, waaronder een mogelijke schorsing van je account. Zij kunnen verdere actie ondernemen, waaronder een mogelijke schorsing van je account.
@ -560,9 +560,9 @@ nl:
- Om terug te gaan naar de homepage, kan je op elk moment **op het icoontje in de linker bovenhoek klikken.** - Om terug te gaan naar de homepage, kan je op elk moment **op het icoontje in de linker bovenhoek klikken.**
- Mocht je iets willen opzoeken, naar je gebruikerspagina gaan, of ergens anders toe willen navigeren, klik dan op de icoontjes in de rechter bovenhoek. - Mocht je iets willen opzoeken, naar je gebruikerspagina gaan, of ergens anders toe willen navigeren, klik dan op de icoontjes in de rechter bovenhoek.
- Wanneer je een topic leest, kan je naar boven scrollen door op de topic-titel bovenaan de pagina te klikken. - Wanneer je een topic leest, kan je naar boven scrollen door op de topic-titel bovenaan de pagina te klikken.
Om de *onderkant* te bereiken, klik op de pijl naar beneden op de topic voortgangsindicator aan de onderkant van de pagina, Om de *onderkant* te bereiken, klik op de pijl naar beneden op de topic voortgangsindicator aan de onderkant van de pagina,
of klik je op het Laatste Post-veld in de topic-samenvatting onder de eerste post. of klik je op het Laatste Post-veld in de topic-samenvatting onder de eerste post.
welcome_approved: welcome_approved:
@ -600,7 +600,7 @@ nl:
Om nogmaals in te loggen kan je het volgende gebruiken: Om nogmaals in te loggen kan je het volgende gebruiken:
1. Facebook, Google, Twitter, of vele andere ondersteunde logingegevens 1. Facebook, Google, Twitter, of vele andere ondersteunde logingegevens
-- let er wel op dat dit **het zelfde e-mailadres** is waarop je je originele uitnodiging hebt gekregen. Anders weten we niet zeker dat jij het bent! -- let er wel op dat dit **het zelfde e-mailadres** is waarop je je originele uitnodiging hebt gekregen. Anders weten we niet zeker dat jij het bent!
2. Maak een uniek wachtwoord voor %{site_name} aan binnen [je gebruikersprofiel][prefs], en log daarmee in. 2. Maak een uniek wachtwoord voor %{site_name} aan binnen [je gebruikersprofiel][prefs], en log daarmee in.
@ -626,7 +626,7 @@ nl:
unsubscribe_link: "Mocht je deze e-mails niet langer willen ontvangen, bezoek dan [je gebruikersinstellingen](%{user_preferences_url})." unsubscribe_link: "Mocht je deze e-mails niet langer willen ontvangen, bezoek dan [je gebruikersinstellingen](%{user_preferences_url})."
user_notifications: user_notifications:
unsubscribe: unsubscribe:
title: "Uitschrijven" title: "Uitschrijven"
description: "Niet geïnteresseerd in deze e-mails? Geen probleem! Klik hieronder om direct uitgeschreven te worden:" description: "Niet geïnteresseerd in deze e-mails? Geen probleem! Klik hieronder om direct uitgeschreven te worden:"
@ -645,7 +645,7 @@ nl:
--- ---
%{message} %{message}
--- ---
Bezoek deze link om te reageren: %{base_url}%{url} Bezoek deze link om te reageren: %{base_url}%{url}
user_quoted: user_quoted:
@ -656,7 +656,7 @@ nl:
--- ---
%{message} %{message}
--- ---
Bezoek deze link om te reageren: %{base_url}%{url} Bezoek deze link om te reageren: %{base_url}%{url}
user_mentioned: user_mentioned:
@ -667,7 +667,7 @@ nl:
--- ---
%{message} %{message}
--- ---
Bezoek deze link om te reageren: %{base_url}%{url} Bezoek deze link om te reageren: %{base_url}%{url}
@ -693,9 +693,9 @@ nl:
subject_template: "[%{site_name}] Wachtwoord herstellen" subject_template: "[%{site_name}] Wachtwoord herstellen"
text_body_template: | text_body_template: |
Iemand heeft aangegeven je wachtwoord te willen herstellen op [%{site_name}](%{base_url}). Iemand heeft aangegeven je wachtwoord te willen herstellen op [%{site_name}](%{base_url}).
Ben jij dit niet, kan je zonder problemen deze e-mail negeren. Ben jij dit niet, kan je zonder problemen deze e-mail negeren.
Klik op de volgende link om een nieuw wachtwoord te kiezen: Klik op de volgende link om een nieuw wachtwoord te kiezen:
%{base_url}/users/password-reset/%{email_token} %{base_url}/users/password-reset/%{email_token}
@ -703,14 +703,14 @@ nl:
subject_template: "[%{site_name}] Bevestig je nieuwe e-mailadres" subject_template: "[%{site_name}] Bevestig je nieuwe e-mailadres"
text_body_template: | text_body_template: |
Bevestig je nieuwe e-mailadres voor %{site_name} door op de volgende link te klikken: Bevestig je nieuwe e-mailadres voor %{site_name} door op de volgende link te klikken:
%{base_url}/users/authorize-email/%{email_token} %{base_url}/users/authorize-email/%{email_token}
signup: signup:
subject_template: "[%{site_name}] Activeer je nieuwe account" subject_template: "[%{site_name}] Activeer je nieuwe account"
text_body_template: | text_body_template: |
Welkom op %{site_name}! Welkom op %{site_name}!
Klik op de volgende link om je nieuwe account te bevestigen en te activeren: Klik op de volgende link om je nieuwe account te bevestigen en te activeren:
%{base_url}/users/activate-account/%{email_token} %{base_url}/users/activate-account/%{email_token}

Some files were not shown because too many files have changed in this diff Show more