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
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:
@ -44,7 +44,7 @@ This vision translates to the following functional commitments:
- Internet Explorer 9.0, 10.0+
- Firefox 16+
- Google Chrome 23+
- Safari 5+
- Safari 5+
2. Support the latest generation of tablets, 7" or larger
- iPad 2+
- Android 4.1+

View file

@ -9,7 +9,6 @@
Discourse.EmailLog = Discourse.Model.extend({});
Discourse.EmailLog.reopenClass({
create: function(attrs) {
if (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'});
}
});

View file

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

View file

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

View file

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

View file

@ -6,7 +6,6 @@
**/
Discourse.buildRoutes(function() {
this.resource('admin', { path: '/admin' }, function() {
this.route('dashboard', { path: '/' });
this.route('site_settings', { path: '/site_settings' });
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'});
}
});

View file

@ -14,7 +14,4 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
renderTemplate: function() {
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');
}
});

View file

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

View file

@ -11,5 +11,3 @@ Discourse.AdminUsersListPendingRoute = Discourse.Route.extend({
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'});
}
});

View file

@ -1,7 +1,7 @@
//= depend_on 'client.en.yml'
<% 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)
%>
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
DiscoursePluginRegistry.javascripts.each do |js|
require_asset(js)
end
end
%>

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
//= depend_on 'client.en.yml'
<% 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 %>;

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
**/
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;
else
Markdown = {};
// The following text is included for historical reasons, but should
// be taken with a pinch of salt; it's not all true anymore.
@ -107,26 +107,26 @@ else
Markdown.Converter = function () {
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
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
pluginHooks.addNoop("preConversion");
// called with the text once all normalizations have been completed (tabs to spaces, line endings, etc.), but before any conversions have
pluginHooks.addNoop("postNormalization");
// 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
// call will receive outdented text.
pluginHooks.addNoop("preBlockGamut");
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
pluginHooks.addNoop("preSpanGamut");
pluginHooks.addNoop("postSpanGamut");
// called with the final cooked HTML code. The result of this plugin hook is the actual output of makeHtml
pluginHooks.addNoop("postConversion");
@ -156,7 +156,7 @@ else
// Don't do that.
if (g_urls)
throw new Error("Recursive call to converter.makeHtml");
// Create the private state objects.
g_urls = new SaveHash();
g_titles = new SaveHash();
@ -191,7 +191,7 @@ else
// match consecutive blank lines with /\n+/ instead of something
// contorted like /[ \t]*\n+/ .
text = text.replace(/^[ \t]+$/mg, "");
text = pluginHooks.postNormalization(text);
// 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);
// 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(/
@ -403,7 +403,7 @@ else
return blockText;
}
var blockGamutHookCallback = function (t) { return _RunBlockGamut(t); }
function _RunBlockGamut(text, doNotUnhash) {
@ -411,9 +411,9 @@ else
// These are all the transformations that form block-level
// tags like paragraphs, headers, and list items.
//
text = pluginHooks.preBlockGamut(text, blockGamutHookCallback);
text = _DoHeaders(text);
// Do Horizontal Rules:
@ -425,7 +425,7 @@ else
text = _DoLists(text);
text = _DoCodeBlocks(text);
text = _DoBlockQuotes(text);
text = pluginHooks.postBlockGamut(text, blockGamutHookCallback);
// We already ran _HashHTMLBlocks() before, in Markdown(), but that
@ -445,7 +445,7 @@ else
//
text = pluginHooks.preSpanGamut(text);
text = _DoCodeSpans(text);
text = _EscapeSpecialCharsWithinTagAttributes(text);
text = _EncodeBackslashEscapes(text);
@ -459,15 +459,15 @@ else
// Must come after _DoAnchors(), because you can use < and >
// delimiters in inline links like [this](<url>).
text = _DoAutoLinks(text);
text = text.replace(/~P/g, "://"); // put in place to prevent autolinking; reset now
text = _EncodeAmpsAndAngles(text);
text = _DoItalicsAndBold(text);
// Do hard breaks:
text = text.replace(/ +\n/g, " <br>\n");
text = pluginHooks.postSpanGamut(text);
return text;
@ -479,7 +479,7 @@ else
// 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.
// SE: changed the comment part of the regex
@ -553,7 +553,7 @@ else
|
[^()\s]
)*?
)>?
)>?
[ \t]*
( // $5
(['"]) // quote char = $6
@ -692,7 +692,7 @@ else
return text;
}
function attributeEncode(text) {
// 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)
@ -725,7 +725,7 @@ else
return whole_match;
}
}
alt_text = escapeCharacters(attributeEncode(alt_text), "*_[]()");
url = escapeCharacters(url, "*_");
var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\"";
@ -749,7 +749,7 @@ else
// Setext-style headers:
// Header 1
// ========
//
//
// Header 2
// --------
//
@ -908,7 +908,7 @@ else
//
// We changed this to behave identical to MarkdownSharp. This is the constructed RegEx,
// with {MARKER} being one of \d+[.] or [*+-], depending on list_type:
/*
list_str = list_str.replace(/
(^[ \t]*) // leading whitespace = $1
@ -956,7 +956,7 @@ else
function _DoCodeBlocks(text) {
//
// Process Markdown `<pre><code>` blocks.
//
//
/*
text = text.replace(/
@ -1004,26 +1004,26 @@ else
function _DoCodeSpans(text) {
//
// * Backtick quotes are used for <code></code> spans.
//
//
// * You can use multiple backticks as the delimiters if you want to
// include literal backticks in the code span. So, this input:
//
//
// Just type ``foo `bar` baz`` at the prompt.
//
//
// Will translate to:
//
//
// <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
//
//
// There's no arbitrary limit to the number of backticks you
// can use as delimters. If you need three consecutive backticks
// in your code, use four for delimiters, etc.
//
// * You can use spaces to get literal backticks at the edges:
//
//
// ... type `` `bar` `` ...
//
//
// Turns to:
//
//
// ... type <code>`bar`</code> ...
//
@ -1156,7 +1156,7 @@ else
var grafs = text.split(/\n{2,}/g);
var grafsOut = [];
var markerRe = /~K(\d+)K/;
//
@ -1230,7 +1230,7 @@ else
text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, escapeCharacters_callback);
return text;
}
function handleTrailingParens(wholeMatch, lookbehind, protocol, link) {
if (lookbehind)
return wholeMatch;
@ -1257,7 +1257,7 @@ else
return "";
});
}
return "<" + protocol + link + ">" + tail;
}
@ -1273,13 +1273,13 @@ else
text = text.replace(/(="|='|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens);
// autolink anything like <http://example.com>
var replacer = function (wholematch, m1) {
var replacer = function (wholematch, m1) {
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);
return text;
}
@ -1337,7 +1337,7 @@ else
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) {
if (!url)
return "";

View file

@ -77,7 +77,7 @@
// -------------------------------------------------------------------
// 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.
// -------------------------------------------------------------------
@ -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.
// - refreshPreview() forces the preview to be updated. This method is only available after run() was called.
Markdown.Editor = function (markdownConverter, idPostfix, options) {
options = options || {};
if (typeof options.handler === "function") { //backwards compatible behavior
@ -230,7 +230,7 @@
beforeReplacer = function (s) { that.before += s; return ""; }
afterReplacer = function (s) { that.after = s + that.after; return ""; }
}
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.
// Cached so we don't have to keep traversing the DOM.
// Also holds ieCachedRange and ieCachedScrollTop, where necessary; working around
// this issue:
// 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
// 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
@ -652,7 +652,7 @@
setMode("escape");
}
else if ((keyCode < 16 || keyCode > 20) && keyCode != 91) {
// 16-20 are shift, etc.
// 16-20 are shift, etc.
// 91: left window key
// I think this might be a little messed up since there are
// a lot of nonprinting keys above 20.
@ -796,7 +796,7 @@
if (panels.ieCachedRange)
stateObj.scrollTop = panels.ieCachedScrollTop; // this is set alongside with ieCachedRange
panels.ieCachedRange = null;
this.setInputAreaSelection();
@ -907,7 +907,7 @@
pushPreviewHtml(text);
};
// makePreviewHtml = window.probes.measure(makePreviewHtml, {
// before: function(){ window.probes.clear(); },
// 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 timeout = null;
return function(){
@ -926,26 +926,26 @@
timeout = null;
func.apply(context, args);
};
if (timeout!=null && trickle) {
return;
}
var currentWait;
var currentWait;
if (typeof wait == "function") {
currentWait = wait();
} else {
currentWait = wait;
}
//console.log(currentWait);
if (timeout) { clearTimeout(timeout); }
timeout = setTimeout(later, currentWait);
}
}
makePreviewHtml = debounce(makePreviewHtml, function(){
return Math.min(Math.max((elapsedTime || 1) * 10, 80),1000);
makePreviewHtml = debounce(makePreviewHtml, function(){
return Math.min(Math.max((elapsedTime || 1) * 10, 80),1000);
}, true);
@ -1086,9 +1086,9 @@
var background = doc.createElement("div"),
style = background.style;
background.className = "wmd-prompt-background";
style.position = "absolute";
style.top = "0";
@ -1400,7 +1400,7 @@
//
// var link = CreateLinkDialog();
// makeMarkdownLink(link);
//
//
// Instead of this straightforward method of handling a
// dialog I have to pass any code which would execute
// after the dialog is dismissed (e.g. link creation)
@ -1511,7 +1511,7 @@
var b = insertButtons[i];
makeButton(b.id, b.description, b.execute)
}
}
}
}
buttons.bold = makeButton("wmd-bold-button", getString("bold"), bindCommand("doBold"));
@ -1767,7 +1767,7 @@
}
else {
// 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
// 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,
// the first bracket could then not act as the "not a backslash" for the second.
chunk.selection = (" " + chunk.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1);
var linkDef = " [999]: " + properlyEncoded(link);
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}>[ \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:
// 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
@ -1875,7 +1875,7 @@
commandMgr.doCode(chunk);
}
}
if (fakeSelection) {
chunk.after = chunk.selection + chunk.after;
chunk.selection = "";

View file

@ -7,7 +7,7 @@
output = window.Markdown;
Converter = output.Converter;
}
output.getSanitizingConverter = function () {
var converter = new Converter();
converter.hooks.chain("postConversion", sanitizeHtml);
@ -37,9 +37,9 @@
/// <summary>
/// attempt to balance HTML tags in the html string
/// 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!
///
///
/// adapted from CODESNIPPET: A8591DBA-D1D3-11DE-947C-BA5556D89593
/// </summary>
function balanceTags(html) {

View file

@ -48,7 +48,7 @@
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d)
}, 0)
}
}
Button.prototype.toggle = function () {
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
// by Patrick Filler for Harvest, http://getharvest.com
//
//
// Version 0.9.8
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com

View file

@ -1752,7 +1752,7 @@ var MapWithDefault = Ember.MapWithDefault = function(options) {
@static
@param [options]
@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`
*/
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
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.)
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
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.)
On all newer browsers, you only need to use this method to set
@ -4229,7 +4229,7 @@ Ember.RunLoop = RunLoop;
```javascript
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
Ember.run.begin();
// code to be execute within a RunLoop
// code to be execute within a RunLoop
Ember.run.end();
```
@ -4286,7 +4286,7 @@ Ember.run.begin = function() {
```javascript
Ember.run.begin();
// code to be execute within a RunLoop
// code to be execute within a RunLoop
Ember.run.end();
```
@ -7358,7 +7358,7 @@ Ember.Enumerable = Ember.Mixin.create(
@method nextObject
@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`.
@param {Object} context a context object you can use to maintain state.
@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
@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
@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.
@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()`
@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.
@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*.
@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*
*/
replace: Ember.required(),
@ -10160,14 +10160,14 @@ CoreObject.PrototypeMixin = Mixin.create({
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
```
Adding a single property that is not an array will just add it in the array:
```javascript
var view = App.FooBarView.create({
classNames: 'baz'
})
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
```
Using the `concatenatedProperties` property, we can tell to Ember that mix
the content of the properties.
@ -14250,7 +14250,7 @@ class:
* `mouseEnter`
* `mouseLeave`
Form events:
Form events:
* `submit`
* `change`
@ -14258,7 +14258,7 @@ class:
* `focusOut`
* `input`
HTML5 drag and drop events:
HTML5 drag and drop events:
* `dragStart`
* `drag`
@ -15795,14 +15795,14 @@ Ember.View.reopenClass({
`className` and optional `falsyClassName`.
- 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
- if the value is falsy and `falsyClassName` has been specified,
- if the value is falsy and `falsyClassName` has been specified,
`falsyClassName` 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
- if the value is not `false`, `undefined` or `null`, the `value`
- if the value is not `false`, `undefined` or `null`, the `value`
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:
```javascript
```javascript
someItemsView = Ember.CollectionView.create({
classNames: ['a-collection'],
content: ['A','B','C'],
@ -17824,7 +17824,7 @@ Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
## Example with bound options
Bound hash options are also supported. Example:
Bound hash options are also supported. Example:
```handlebars
{{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,
the helpr will re-render. Note that dependency keys cannot be
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
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.
```handlebars
{{unbound capitalize name}}
{{unbound capitalize name}}
```
In this example, if the name property changes, the helper
@ -17896,7 +17896,7 @@ Ember.Handlebars.registerBoundHelper = function(name, fn) {
view = data.view,
currentContext = (options.contexts && options.contexts[0]) || this,
normalized,
pathRoot, path,
pathRoot, path,
loc, hashOption;
// 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.
watchedProperties = [];
for (boundOption in boundOptions) {
if (boundOptions.hasOwnProperty(boundOption)) {
if (boundOptions.hasOwnProperty(boundOption)) {
watchedProperties.push(normalizePath(context, boundOptions[boundOption], data));
}
}
@ -18937,14 +18937,14 @@ EmberHandlebars.registerHelper('unless', function(context, options) {
Result in the following rendered output:
```html
```html
<img class="aValue">
```
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`.
A class name is provided via the syntax
A class name is provided via the syntax
`somePropertyName:class-name-if-true`.
```javascript
@ -19103,9 +19103,9 @@ EmberHandlebars.registerHelper('bindAttr', function(options) {
@method bindClasses
@for Ember.Handlebars
@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
@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
@param {Srting} bindAttrId Optional bindAttr id used to lookup elements
@return {Array} An array of class names to add
@ -19795,7 +19795,7 @@ Ember.Handlebars.registerHelper('unbound', function(property, fn) {
// Unbound helper call.
options.data.isUnbound = true;
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;
return out;
}
@ -21093,7 +21093,7 @@ helpers = helpers || Ember.Handlebars.helpers; data = data || {};
var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this;
function program1(depth0,data) {
var buffer = '', hashTypes;
data.buffer.push("<option value=\"\">");
hashTypes = {};
@ -21103,7 +21103,7 @@ function program1(depth0,data) {
}
function program3(depth0,data) {
var hashTypes;
hashTypes = {'contentBinding': "STRING"};
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});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
return buffer;
}),
attributeBindings: ['multiple', 'disabled', 'tabindex'],

View file

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

View file

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

View file

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

View file

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

View file

@ -1,8 +1,8 @@
// Animates the dimensional changes resulting from altering element contents
// Usage examples:
// Usage examples:
// $("#myElement").showHtml("new HTML contents");
// $("div").showHtml("new HTML contents", 400);
// $(".className").showHtml("new HTML contents", 400,
// $(".className").showHtml("new HTML contents", 400,
// function() {/* on completion */});
(function($)
{
@ -13,22 +13,22 @@
// The element to be modified
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
// the animation has completed.
var finish = {width: this.style.width, height: this.style.height};
// The original width and height represented as pixel values.
// These will only be the same as `finish` if this element had its
// dimensions specified explicitly and in pixels. Of course, if that
// was done then this entire routine is pointless, as the dimensions
// dimensions specified explicitly and in pixels. Of course, if that
// was done then this entire routine is pointless, as the dimensions
// won't change when the content is changed.
var cur = {width: el.width()+'px', height: el.height()+'px'};
// Modify the element's contents. Element will resize.
el.html(html);
// Capture the final dimensions of the element
// Capture the final dimensions of the element
// (with initial style settings still in effect)
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
@param [options]
@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`
*/
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
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.)
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
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.)
On all newer browsers, you only need to use this method to set
@ -4069,7 +4069,7 @@ Ember.RunLoop = RunLoop;
```javascript
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
Ember.run.begin();
// code to be execute within a RunLoop
// code to be execute within a RunLoop
Ember.run.end();
```
@ -4126,7 +4126,7 @@ Ember.run.begin = function() {
```javascript
Ember.run.begin();
// code to be execute within a RunLoop
// code to be execute within a RunLoop
Ember.run.end();
```
@ -7197,7 +7197,7 @@ Ember.Enumerable = Ember.Mixin.create(
@method nextObject
@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`.
@param {Object} context a context object you can use to maintain state.
@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
@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
@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.
@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()`
@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.
@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*.
@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*
*/
replace: Ember.required(),
@ -9998,14 +9998,14 @@ CoreObject.PrototypeMixin = Mixin.create({
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
```
Adding a single property that is not an array will just add it in the array:
```javascript
var view = App.FooBarView.create({
classNames: 'baz'
})
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
```
Using the `concatenatedProperties` property, we can tell to Ember that mix
the content of the properties.
@ -14080,7 +14080,7 @@ class:
* `mouseEnter`
* `mouseLeave`
Form events:
Form events:
* `submit`
* `change`
@ -14088,7 +14088,7 @@ class:
* `focusOut`
* `input`
HTML5 drag and drop events:
HTML5 drag and drop events:
* `dragStart`
* `drag`
@ -15619,14 +15619,14 @@ Ember.View.reopenClass({
`className` and optional `falsyClassName`.
- 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
- if the value is falsy and `falsyClassName` has been specified,
- if the value is falsy and `falsyClassName` has been specified,
`falsyClassName` 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
- if the value is not `false`, `undefined` or `null`, the `value`
- if the value is not `false`, `undefined` or `null`, the `value`
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:
```javascript
```javascript
someItemsView = Ember.CollectionView.create({
classNames: ['a-collection'],
content: ['A','B','C'],
@ -17647,7 +17647,7 @@ Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
## Example with bound options
Bound hash options are also supported. Example:
Bound hash options are also supported. Example:
```handlebars
{{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,
the helpr will re-render. Note that dependency keys cannot be
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
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.
```handlebars
{{unbound capitalize name}}
{{unbound capitalize name}}
```
In this example, if the name property changes, the helper
@ -17719,7 +17719,7 @@ Ember.Handlebars.registerBoundHelper = function(name, fn) {
view = data.view,
currentContext = (options.contexts && options.contexts[0]) || this,
normalized,
pathRoot, path,
pathRoot, path,
loc, hashOption;
// 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.
watchedProperties = [];
for (boundOption in boundOptions) {
if (boundOptions.hasOwnProperty(boundOption)) {
if (boundOptions.hasOwnProperty(boundOption)) {
watchedProperties.push(normalizePath(context, boundOptions[boundOption], data));
}
}
@ -18757,14 +18757,14 @@ EmberHandlebars.registerHelper('unless', function(context, options) {
Result in the following rendered output:
```html
```html
<img class="aValue">
```
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`.
A class name is provided via the syntax
A class name is provided via the syntax
`somePropertyName:class-name-if-true`.
```javascript
@ -18919,9 +18919,9 @@ EmberHandlebars.registerHelper('bindAttr', function(options) {
@method bindClasses
@for Ember.Handlebars
@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
@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
@param {Srting} bindAttrId Optional bindAttr id used to lookup elements
@return {Array} An array of class names to add
@ -19610,7 +19610,7 @@ Ember.Handlebars.registerHelper('unbound', function(property, fn) {
// Unbound helper call.
options.data.isUnbound = true;
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;
return out;
}
@ -20905,7 +20905,7 @@ helpers = helpers || Ember.Handlebars.helpers; data = data || {};
var buffer = '', stack1, hashTypes, escapeExpression=this.escapeExpression, self=this;
function program1(depth0,data) {
var buffer = '', hashTypes;
data.buffer.push("<option value=\"\">");
hashTypes = {};
@ -20915,7 +20915,7 @@ function program1(depth0,data) {
}
function program3(depth0,data) {
var hashTypes;
hashTypes = {'contentBinding': "STRING"};
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});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
return buffer;
}),
attributeBindings: ['multiple', 'disabled', 'tabindex'],

View file

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

View file

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

View file

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

View file

@ -14,7 +14,7 @@
.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;}
/*
/*
User Style:
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.
@ -39,7 +39,7 @@
/* 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; }
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}

View file

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

View file

@ -52,7 +52,7 @@
*border: 1px solid #999;
/* IE6-7 */
@include border-radius-all (6px);
@include border-radius-all (6px);
-webkit-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);
@ -106,19 +106,19 @@
border-bottom: 1px solid #9baab2;
@include box-shadow((0 1px 3px rgba($black, 0.12), inset 0 -4px 4px -4px rgba($black, 0.3)));
h3 {
color: $nav-pills-background-color-active;
color: $nav-pills-background-color-active;
font-size: 20px;
padding: 10px 15px 7px;
}
}
.close {
float: right;
font-size: 20px;
margin: 10px 10px 0px;
text-decoration: none;
color: $modal-close-button-color;
color: $modal-close-button-color;
cursor: pointer;
&: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 {
background-color: $post_footer;
background-color: $post_footer;
border-top: 1px solid $inner_border;
overflow: hidden;
@include box-shadow(inset 0 -4px 4px -4px rgba($black, 0.14));
@ -544,7 +544,7 @@
}
.contents.bottom-round {
overflow: hidden;
background-clip: padding-box;
background-clip: padding-box;
@include border-radius-bottom(4px);
@include box-shadow(0 1px 2px rgba($black, 0.07));
}
@ -599,7 +599,7 @@
}
.topic-post.hidden {
display: block;
display: block;
opacity: 0.4;
}
@ -607,7 +607,7 @@
opacity: 0.8;
article.boxed {
.topic-body .contents {
background-color: #ffcece;
background-color: #ffcece;
}
.topic-body::after {
border-right-color: #ffcece;

View file

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

View file

@ -1,33 +1,33 @@
div.tagsinput {
border:1px solid #CCC;
background: #FFF;
padding:5px 5px 0px;
width:584px;
height:100px;
overflow-y: auto;
div.tagsinput {
border:1px solid #CCC;
background: #FFF;
padding:5px 5px 0px;
width:584px;
height:100px;
overflow-y: auto;
border-radius: 4px;
}
div.tagsinput span.tag {
border: 1px solid #a5d24a;
-moz-border-radius:2px;
-webkit-border-radius:2px;
border-radius: 2px;
display: block;
float: left;
padding: 1px 5px;
text-decoration:none;
background: #cde69c;
color: #638421;
margin-right: 5px;
div.tagsinput span.tag {
border: 1px solid #a5d24a;
-moz-border-radius:2px;
-webkit-border-radius:2px;
border-radius: 2px;
display: block;
float: left;
padding: 1px 5px;
text-decoration:none;
background: #cde69c;
color: #638421;
margin-right: 5px;
margin-bottom:5px;
font-family: helvetica;
font-family: helvetica;
font-size:13px;
}
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 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;
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; }
.not_valid {background: #FBD8DB !important; color: #90111A !important;}

View file

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

View file

@ -26,13 +26,13 @@
/* @group Single Chosen */
.chzn-container-single .chzn-single {
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-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: -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;
-moz-border-radius : 5px;
border-radius : 5px;
@ -182,13 +182,13 @@
-webkit-background-clip: padding-box;
background-clip : padding-box;
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-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: -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);
-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);
@ -248,7 +248,7 @@
}
.chzn-container .chzn-results .highlighted {
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-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 {
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-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, -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%);
@ -392,4 +392,4 @@
padding: 4px 5px 4px 20px;
direction: rtl;
}
/* @end */
/* @end */

View file

@ -7,7 +7,7 @@ require_dependency 'rate_limiter'
class ApplicationController < ActionController::Base
include CurrentUser
include CanonicalURL::ControllerExtensions
serialization_scope :guardian
@ -79,8 +79,8 @@ class ApplicationController < ActionController::Base
def store_preloaded(key, json)
@preloaded ||= {}
# 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
# 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
# to inject this safty deeper in the library or even in AM serializer
@preloaded[key] = json.gsub("</", "<\\/")
end

View file

@ -5,11 +5,11 @@ class EducationController < ApplicationController
def show
raise Discourse::InvalidAccess.new unless params[:id] =~ /^[a-z0-9\-\_]+$/
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)
markdown_content = MultisiteI18n.t("education.#{params[:id]}",
site_name: SiteSetting.title,
markdown_content = MultisiteI18n.t("education.#{params[:id]}",
site_name: SiteSetting.title,
education_posts_text: education_posts_text)
render text: PrettyText.cook(markdown_content)
end

View file

@ -72,7 +72,7 @@ class PostActionsController < ApplicationController
finder = Post.where(id: params[:id])
# 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
guardian.ensure_can_see!(@post)

View file

@ -57,7 +57,7 @@ class PostsController < ApplicationController
result = {post: post_serializer.as_json}
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
render_json_dump(result)
@ -127,7 +127,7 @@ class PostsController < ApplicationController
# Returns the "you're creating a post education"
def education_text
end
def bookmark
@ -149,10 +149,10 @@ class PostsController < ApplicationController
finder = Post.where(id: params[:id] || params[:post_id])
# 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
guardian.ensure_can_see!(post)
post
end
end
end

View file

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

View file

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

View file

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

View file

@ -171,7 +171,7 @@ class Post < ActiveRecord::Base
# As a moderator, delete the post.
Post.transaction do
self.destroy
Topic.reset_highest(self.topic_id)
Topic.reset_highest(self.topic_id)
end
elsif deleted_by.id == self.user_id
# 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
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,
'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
action.destroy
action.deleted_at = Time.now
action.run_callbacks(:save)
action.run_callbacks(:save)
end
end
@ -127,9 +127,9 @@ class PostAction < ActiveRecord::Base
end
before_create do
raise AlreadyFlagged if is_flag? and PostAction.where(user_id: user_id,
post_id: post_id,
post_action_type_id: PostActionType.FlagTypes).exists?
raise AlreadyFlagged if is_flag? and PostAction.where(user_id: user_id,
post_id: post_id,
post_action_type_id: PostActionType.FlagTypes).exists?
end
after_save do
@ -167,8 +167,8 @@ class PostAction < ActiveRecord::Base
# inform user
if self.post.user
SystemMessage.create(self.post.user, :post_hidden,
url: self.post.url,
SystemMessage.create(self.post.user, :post_hidden,
url: self.post.url,
edit_delay: SiteSetting.cooldown_minutes_after_hiding_posts)
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)
current_user.update_time_read!
original_unread = current_user.unread_notifications_by_type
timings.each do |post_number, time|
if post_number >= 0
@ -57,7 +57,7 @@ class PostTiming < ActiveRecord::Base
if timings.length > 0
total_changed = Notification.mark_posts_read(current_user, topic_id, timings.map{|t| t[0]})
end
TopicUser.update_last_read(current_user, topic_id, highest_seen, topic_time)
if total_changed > 0

View file

@ -70,7 +70,7 @@ class Topic < ActiveRecord::Base
before_validation do
if self.title.present?
self.title = sanitize(self.title)
self.title.strip!
self.title.strip!
end
end
@ -119,7 +119,7 @@ class Topic < ActiveRecord::Base
errors.add(:title, I18n.t(:has_already_been_used)) if finder.exists?
end
def fancy_title
def fancy_title
return title unless SiteSetting.title_fancy_entities?
# 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
return if private_message?
sentinel = TextSentinel.title_sentinel(title)
sentinel = TextSentinel.title_sentinel(title)
if sentinel.valid?
# It's possible the sentinel has cleaned up the title a bit
self.title = sentinel.text
@ -179,11 +179,11 @@ class Topic < ActiveRecord::Base
def self.visible
where(visible: true)
end
def self.created_since(time_ago)
where("created_at > ?", time_ago)
end
def private_message?
self.archetype == Archetype.private_message
end

View file

@ -18,7 +18,7 @@ class TopicUser < ActiveRecord::Base
end
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,
notification_level: NotificationLevel::TRACKING,
notifications_reason_id: reason

View file

@ -46,7 +46,7 @@ class User < ActiveRecord::Base
attr_accessor :notification_channel_position
module NewTopicDuration
ALWAYS = -1
ALWAYS = -1
LAST_VISIT = -2
end
@ -57,7 +57,7 @@ class User < ActiveRecord::Base
def self.suggest_username(name)
return nil unless name.present?
# If it's an email
if name =~ /([^@]+)@([^\.]+)/
name = Regexp.last_match[1]
@ -433,20 +433,20 @@ class User < ActiveRecord::Base
end
def treat_as_new_topic_start_date
duration = new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes
case duration
duration = new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes
case duration
when User::NewTopicDuration::ALWAYS
created_at
when User::NewTopicDuration::LAST_VISIT
previous_visit_at || created_at
else
duration.minutes.ago
end
end
end
MAX_TIME_READ_DIFF = 100
# 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 = $redis.get(last_seen_key)
if last_seen.present?

View file

@ -48,7 +48,7 @@ class UserAction < ActiveRecord::Base
unless guardian.can_see_private_messages?(user_id)
results = results.where('topics.archetype <> ?', Archetype::private_message)
end
unless guardian.user && guardian.user.id == user_id
results = results.where("action_type <> ?", BOOKMARK)
end
@ -76,16 +76,16 @@ class UserAction < ActiveRecord::Base
guardian = opts[:guardian]
ignore_private_messages = opts[:ignore_private_messages]
# 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.
# 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.
builder = SqlBuilder.new("
SELECT
t.title, a.action_type, a.created_at, t.id topic_id,
coalesce(p.post_number, 1) post_number,
SELECT
t.title, a.action_type, a.created_at, t.id topic_id,
coalesce(p.post_number, 1) post_number,
p.reply_to_post_number,
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,
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,
coalesce(p.cooked, p2.cooked) cooked
FROM user_actions as a
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?
builder.where("p.deleted_at is null and p2.deleted_at is null")
end
unless guardian.user && guardian.user.id == user_id
builder.where("a.action_type not in (#{BOOKMARK})")
end

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,7 @@
};
var assetPath = function(asset){
return map[asset];
return map[asset];
};
return assetPath;
@ -20,7 +20,7 @@
<%= javascript_include_tag "application" %>
<%-end%>
<%- Rack::MiniProfiler.step "admin" do %>
<%- Rack::MiniProfiler.step "admin" do %>
<%= javascript_include_tag "admin"%>
<%-end%>
<%- 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"%>
<%- end %>
<%- if mini_profiler_enabled? %>
<%- Rack::MiniProfiler.step "stylsheet" do%>
<%= stylesheet_link_tag "admin"%>
<%= stylesheet_link_tag "admin"%>
<%-end%>
<%- elsif admin? %>
<%= stylesheet_link_tag "admin"%>
<%-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 path. This is to get around CDN caching on the Origin:
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>
@font-face {
@ -27,5 +27,5 @@
font-weight: normal;
font-style: normal;
}
</style>
}
</style>

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
<%if flash[:error]%>
<div class='alert alert-error'>
<%=flash[:error]%>
<%=flash[:error]%>
</div>
<%else%>
<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>.
<% end %>
</p>
<%end%>
</div>
</div>

View file

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

View file

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

View file

@ -101,13 +101,13 @@ ExTreshold: 4
# Experimental feature for apt-listbugs: pass-through SOAP requests and
# responses to/from bugs.debian.org. If not set, default is true if
# ForceManaged is enabled and false otherwise.
# ForwardBtsSoap: 1
# ForwardBtsSoap: 1
# 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.
# 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
# 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
# feature set, i.e.
# feature set, i.e.
# including directory browsing and download of any file;
# excluding sorting, mime types/encodings, CGI execution, index page
# 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
# 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
# (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.
#
# 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
# 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).
# 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,
# default value is 0 if ForceManaged is used and 5 otherwise.
#
# RedirMax: 5
# RedirMax: 5

View file

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

View file

@ -84,7 +84,7 @@ when 'deb'
if(pkgs_avail)
path_name = pkgs_avail.find_all{ |path|
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?(ver)
}.sort.last
@ -104,7 +104,7 @@ when 'rpm'
if(pkgs_avail)
path_name = pkgs_avail.find_all{ |path|
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?(ver)
}.sort.last

View file

@ -30,15 +30,15 @@ module Discourse
config.assets.paths += %W(#{config.root}/config/locales)
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'
]
# Activate observers that should always be running.
config.active_record.observers = [
:user_email_observer,
:user_action_observer,
:message_bus_observer,
:user_action_observer,
:message_bus_observer,
:post_alert_observer,
:search_observer
]
@ -66,10 +66,10 @@ module Discourse
# We need to be able to spin threads
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
# 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
# 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
# So open id logs somewhere sane
config.after_initialize do
config.after_initialize do
OpenID::Util.logger = Rails.logger
end
end

View file

@ -2,7 +2,7 @@ require 'clockwork'
require_relative 'boot'
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.
module Clockwork

View file

@ -26,15 +26,15 @@ Discourse::Application.configure do
config.assets.debug = true
config.watchable_dirs['lib'] = [:rb]
config.sass.debug_info = false
config.ember.variant = :development
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.handlebars.precompile = false
# a bit hacky but works
config.after_initialize do
config.after_initialize do
config.middleware.delete Airbrake::UserInformer
config.middleware.delete Airbrake::Rack
end

View file

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

View file

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

View file

@ -1,4 +1,4 @@
MessageBus.site_id_lookup do
MessageBus.site_id_lookup do
RailsMultisite::ConnectionManagement.current_db
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_interval = SiteSetting.long_polling_interval
MessageBus.is_admin_lookup do |env|
MessageBus.is_admin_lookup do |env|
user = CurrentUser.lookup_from_env(env)
if user && user.admin
true

View file

@ -5,14 +5,14 @@ if defined?(Rack::MiniProfiler)
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore
# 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['PATH_INFO'] !~ /^\/message-bus/) and
(env['PATH_INFO'] !~ /topics\/timings/) and
(env['PATH_INFO'] !~ /assets/) and
(env['PATH_INFO'] !~ /jasmine/) and
(env['PATH_INFO'] !~ /users\/.*\/avatar/) and
(env['PATH_INFO'] !~ /srv\/status/)
(env['PATH_INFO'] !~ /srv\/status/)
end
Rack::MiniProfiler.config.position = 'left'
@ -24,8 +24,8 @@ if defined?(Rack::MiniProfiler)
# require "#{Rails.root}/vendor/backports/notification"
inst = Class.new
class << inst
inst = Class.new
class << inst
def start(name,id,payload)
if Rack::MiniProfiler.current and name !~ /(process_action.action_controller)|(render_template.action_view)/
@prf ||= {}

View file

@ -4,7 +4,7 @@ Rails::Rack::Logger.class_eval do
previous_level = Rails.logger.level
if (env['PATH_INFO'].index("/assets/") == 0) or
(env['PATH_INFO'].index("mini-profiler-resources") == 0)
Rails.logger.level = Logger::ERROR
Rails.logger.level = Logger::ERROR
end
call_without_quiet_assets(env).tap do
@ -12,4 +12,4 @@ Rails::Rack::Logger.class_eval do
end
end
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.
# 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
# session cookies.
# however, the stock one should never be used in production, people will be able to crack
# session cookies.
#
# 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:
#
# Discourse::Application.config.secret_token = "SET_SECRET_HERE"
# Discourse::Application.config.secret_token = "SET_SECRET_HERE"
# delete all lines below in production
if Rails.env.test? || Rails.env.development?
Discourse::Application.config.secret_token = "47f5390004bf6d25bb97083fb98e7cc133ab450ba814dd19638a78282b4ca291"
else
if Rails.env.test? || Rails.env.development?
Discourse::Application.config.secret_token = "47f5390004bf6d25bb97083fb98e7cc133ab450ba814dd19638a78282b4ca291"
else
raise "You must set a secret token in config/initializers/secret_token.rb"
end

View file

@ -3,8 +3,8 @@ class SilenceLogger < Rails::Rack::Logger
@app = app
@opts = opts
@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)
end

View file

@ -1,5 +1,3 @@
RailsMultisite::ConnectionManagement.each_connection do
RailsMultisite::ConnectionManagement.each_connection do
SiteSetting.refresh!
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
# 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
# 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"
old_time = File.ctime(file).to_i if File.exists? file
wait_seconds = 4
return if $PROGRAM_NAME !~ /thin/
while true
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"
$shutdown = true
sleep wait_seconds
Rails.logger.info "restarting #{$$}"
Process.kill("HUP", $$)
Rails.logger.info "restarting #{$$}"
Process.kill("HUP", $$)
return
end

View file

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

View file

@ -350,7 +350,7 @@ en:
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"
title_fancy_entities: "Convert fancy HTML entities in topic titles"
notification_types:
mentioned: "%{display_username} mentioned you in %{link}"
liked: "%{display_username} liked your post in %{link}"

View file

@ -66,7 +66,7 @@ nl:
trust_levels:
new:
title: "nieuwe gebruiker"
basic:
basic:
title: "basisgebruiker"
regular:
title: "gemiddelde gebruiker"
@ -91,7 +91,7 @@ nl:
datetime:
distance_in_words:
half_a_minute: "< 1m"
half_a_minute: "< 1m"
less_than_x_seconds:
one: "< 1s"
other: "< %{count}s"
@ -127,7 +127,7 @@ nl:
other: "%{count}j"
distance_in_words_verbose:
half_a_minute: "een halve minuut geleden"
half_a_minute: "een halve minuut geleden"
less_than_x_seconds:
one: "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!"
post_action_types:
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.'
@ -213,7 +213,7 @@ nl:
user_must_edit: '<p>Gemelde inhoud verborgen.</p>'
archetypes:
regular:
regular:
title: "Standaard-topic"
unsubscribed:
@ -346,7 +346,7 @@ nl:
new_user_period_days: "Hoe lang een gebruiker als nieuw wordt aangetoond, in dagen."
notification_types:
mentioned: "%{display_username} heeft je genoemd in %{link}"
@ -362,13 +362,13 @@ nl:
# This section is exported to the javascript for i18n
js:
search:
types:
category: 'Categorieën'
topic: 'Topics'
user: 'Gebruikers'
user: 'Gebruikers'
youve_posted: "Jij Hebt Dit Gepost"
original_poster: "Originele Poster"
@ -402,7 +402,7 @@ nl:
edited: "bewerkte"
move_posts:
moderator_post:
moderator_post:
one: "Ik heb een post 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_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."
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."
@ -503,7 +503,7 @@ nl:
subject_template: "Bericht van %{site_name}: Je Post is verborgen wegens meldingen uit de site-gemeenschap"
text_body_template: |
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.
%{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.
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.
@ -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.**
- 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.
Om de *onderkant* te bereiken, klik op de pijl naar beneden op de topic voortgangsindicator aan de onderkant van de pagina,
- 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.
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.
welcome_approved:
@ -600,7 +600,7 @@ nl:
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!
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})."
user_notifications:
unsubscribe:
unsubscribe:
title: "Uitschrijven"
description: "Niet geïnteresseerd in deze e-mails? Geen probleem! Klik hieronder om direct uitgeschreven te worden:"
@ -645,7 +645,7 @@ nl:
---
%{message}
---
---
Bezoek deze link om te reageren: %{base_url}%{url}
user_quoted:
@ -656,7 +656,7 @@ nl:
---
%{message}
---
---
Bezoek deze link om te reageren: %{base_url}%{url}
user_mentioned:
@ -667,7 +667,7 @@ nl:
---
%{message}
---
---
Bezoek deze link om te reageren: %{base_url}%{url}
@ -693,9 +693,9 @@ nl:
subject_template: "[%{site_name}] Wachtwoord herstellen"
text_body_template: |
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:
%{base_url}/users/password-reset/%{email_token}
@ -703,14 +703,14 @@ nl:
subject_template: "[%{site_name}] Bevestig je nieuwe e-mailadres"
text_body_template: |
Bevestig je nieuwe e-mailadres voor %{site_name} door op de volgende link te klikken:
%{base_url}/users/authorize-email/%{email_token}
signup:
subject_template: "[%{site_name}] Activeer je nieuwe account"
text_body_template: |
Welkom op %{site_name}!
Klik op de volgende link om je nieuwe account te bevestigen en te activeren:
%{base_url}/users/activate-account/%{email_token}

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