diff --git a/README.md b/README.md index 92bb8f3e3..f5e36046b 100644 --- a/README.md +++ b/README.md @@ -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+ diff --git a/app/assets/javascripts/admin/models/email_log.js b/app/assets/javascripts/admin/models/email_log.js index 1fd292567..f7852501e 100644 --- a/app/assets/javascripts/admin/models/email_log.js +++ b/app/assets/javascripts/admin/models/email_log.js @@ -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); diff --git a/app/assets/javascripts/admin/routes/admin_customize_route.js b/app/assets/javascripts/admin/routes/admin_customize_route.js index e08579156..76f5b0874 100644 --- a/app/assets/javascripts/admin/routes/admin_customize_route.js +++ b/app/assets/javascripts/admin/routes/admin_customize_route.js @@ -15,5 +15,3 @@ Discourse.AdminCustomizeRoute = Discourse.Route.extend({ this.render({into: 'admin/templates/admin'}); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_email_logs_route.js b/app/assets/javascripts/admin/routes/admin_email_logs_route.js index f1fa42513..67a2a5587 100644 --- a/app/assets/javascripts/admin/routes/admin_email_logs_route.js +++ b/app/assets/javascripts/admin/routes/admin_email_logs_route.js @@ -15,5 +15,3 @@ Discourse.AdminEmailLogsRoute = Discourse.Route.extend({ this.render('admin/templates/email_logs'); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_flags_route.js b/app/assets/javascripts/admin/routes/admin_flags_route.js index 7def67540..19c7b1889 100644 --- a/app/assets/javascripts/admin/routes/admin_flags_route.js +++ b/app/assets/javascripts/admin/routes/admin_flags_route.js @@ -11,5 +11,3 @@ Discourse.AdminFlagsRoute = Discourse.Route.extend({ this.render('admin/templates/flags'); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_route.js b/app/assets/javascripts/admin/routes/admin_route.js index a28ffff2e..7bee2b183 100644 --- a/app/assets/javascripts/admin/routes/admin_route.js +++ b/app/assets/javascripts/admin/routes/admin_route.js @@ -11,5 +11,3 @@ Discourse.AdminRoute = Discourse.Route.extend({ this.render('admin/templates/admin'); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_routes.js b/app/assets/javascripts/admin/routes/admin_routes.js index 215a7ba14..bb583fdc9 100644 --- a/app/assets/javascripts/admin/routes/admin_routes.js +++ b/app/assets/javascripts/admin/routes/admin_routes.js @@ -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' }); diff --git a/app/assets/javascripts/admin/routes/admin_site_settings_route.js b/app/assets/javascripts/admin/routes/admin_site_settings_route.js index 5043b40a0..f572d53b3 100644 --- a/app/assets/javascripts/admin/routes/admin_site_settings_route.js +++ b/app/assets/javascripts/admin/routes/admin_site_settings_route.js @@ -15,5 +15,3 @@ Discourse.AdminSiteSettingsRoute = Discourse.Route.extend({ this.render('admin/templates/site_settings', {into: 'admin/templates/admin'}); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_user_route.js b/app/assets/javascripts/admin/routes/admin_user_route.js index 343dce695..24598f09c 100644 --- a/app/assets/javascripts/admin/routes/admin_user_route.js +++ b/app/assets/javascripts/admin/routes/admin_user_route.js @@ -14,7 +14,4 @@ Discourse.AdminUserRoute = Discourse.Route.extend({ renderTemplate: function() { this.render('admin/templates/user', {into: 'admin/templates/admin'}); } - }); - - diff --git a/app/assets/javascripts/admin/routes/admin_users_list_active_route.js b/app/assets/javascripts/admin/routes/admin_users_list_active_route.js index 46b23537b..071a9cf7a 100644 --- a/app/assets/javascripts/admin/routes/admin_users_list_active_route.js +++ b/app/assets/javascripts/admin/routes/admin_users_list_active_route.js @@ -11,5 +11,3 @@ Discourse.AdminUsersListActiveRoute = Discourse.Route.extend({ return this.controllerFor('adminUsersList').show('active'); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_users_list_new_route.js b/app/assets/javascripts/admin/routes/admin_users_list_new_route.js index 48f22a38e..365c0e71a 100644 --- a/app/assets/javascripts/admin/routes/admin_users_list_new_route.js +++ b/app/assets/javascripts/admin/routes/admin_users_list_new_route.js @@ -11,5 +11,3 @@ Discourse.AdminUsersListNewRoute = Discourse.Route.extend({ return this.controllerFor('adminUsersList').show('new'); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_users_list_pending_route.js b/app/assets/javascripts/admin/routes/admin_users_list_pending_route.js index bd2efaf6a..8fb862f4a 100644 --- a/app/assets/javascripts/admin/routes/admin_users_list_pending_route.js +++ b/app/assets/javascripts/admin/routes/admin_users_list_pending_route.js @@ -11,5 +11,3 @@ Discourse.AdminUsersListPendingRoute = Discourse.Route.extend({ return this.controllerFor('adminUsersList').show('pending'); } }); - - diff --git a/app/assets/javascripts/admin/routes/admin_users_list_route.js b/app/assets/javascripts/admin/routes/admin_users_list_route.js index 757c7efa2..e08ee02f8 100644 --- a/app/assets/javascripts/admin/routes/admin_users_list_route.js +++ b/app/assets/javascripts/admin/routes/admin_users_list_route.js @@ -11,5 +11,3 @@ Discourse.AdminUsersListRoute = Discourse.Route.extend({ this.render('admin/templates/users_list', {into: 'admin/templates/admin'}); } }); - - diff --git a/app/assets/javascripts/admin/translations.js.erb b/app/assets/javascripts/admin/translations.js.erb index 275b322bf..1f70ef3fe 100644 --- a/app/assets/javascripts/admin/translations.js.erb +++ b/app/assets/javascripts/admin/translations.js.erb @@ -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 %>); diff --git a/app/assets/javascripts/admin/views/admin_customize_view.js b/app/assets/javascripts/admin/views/admin_customize_view.js index 90bb032c2..213c385eb 100644 --- a/app/assets/javascripts/admin/views/admin_customize_view.js +++ b/app/assets/javascripts/admin/views/admin_customize_view.js @@ -46,5 +46,3 @@ Discourse.AdminCustomizeView = Discourse.View.extend({ } }); - - diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 50d65abb6..b5da1a238 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -49,5 +49,5 @@ # Include javascripts DiscoursePluginRegistry.javascripts.each do |js| require_asset(js) - end + end %> diff --git a/app/assets/javascripts/defer/html-sanitizer-bundle.js b/app/assets/javascripts/defer/html-sanitizer-bundle.js index 16c375f4a..363a5ce40 100644 --- a/app/assets/javascripts/defer/html-sanitizer-bundle.js +++ b/app/assets/javascripts/defer/html-sanitizer-bundle.js @@ -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 { diff --git a/app/assets/javascripts/discourse/components/bbcode.js b/app/assets/javascripts/discourse/components/bbcode.js index dd474985d..dc4758157 100644 --- a/app/assets/javascripts/discourse/components/bbcode.js +++ b/app/assets/javascripts/discourse/components/bbcode.js @@ -190,4 +190,4 @@ Discourse.BBCode = { text = Discourse.BBCode.formatQuote(text, opts); return text; } -}; \ No newline at end of file +}; diff --git a/app/assets/javascripts/discourse/components/debounce.js b/app/assets/javascripts/discourse/components/debounce.js index 2c081cf48..9141e2fc3 100644 --- a/app/assets/javascripts/discourse/components/debounce.js +++ b/app/assets/javascripts/discourse/components/debounce.js @@ -31,7 +31,7 @@ Discourse.debounce = function(func, wait, trickle) { } else { currentWait = wait; } - + if (timeout) { clearTimeout(timeout); } diff --git a/app/assets/javascripts/discourse/components/probes.js b/app/assets/javascripts/discourse/components/probes.js index e2a497904..f341f944c 100644 --- a/app/assets/javascripts/discourse/components/probes.js +++ b/app/assets/javascripts/discourse/components/probes.js @@ -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; diff --git a/app/assets/javascripts/discourse/components/screen_track.js b/app/assets/javascripts/discourse/components/screen_track.js index 3d50638bf..45dbfde3d 100644 --- a/app/assets/javascripts/discourse/components/screen_track.js +++ b/app/assets/javascripts/discourse/components/screen_track.js @@ -155,5 +155,3 @@ Discourse.ScreenTrack = Ember.Object.extend({ } }); - - diff --git a/app/assets/javascripts/discourse/routes/user_route.js b/app/assets/javascripts/discourse/routes/user_route.js index 8ab984e8f..3e2e079f8 100644 --- a/app/assets/javascripts/discourse/routes/user_route.js +++ b/app/assets/javascripts/discourse/routes/user_route.js @@ -15,5 +15,3 @@ Discourse.UserRoute = Discourse.Route.extend({ return { username: Em.get(params, 'username').toLowerCase() }; } }); - - diff --git a/app/assets/javascripts/discourse/translations.js.erb b/app/assets/javascripts/discourse/translations.js.erb index 4058b0eb8..4f30f5b5a 100644 --- a/app/assets/javascripts/discourse/translations.js.erb +++ b/app/assets/javascripts/discourse/translations.js.erb @@ -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 %>; diff --git a/app/assets/javascripts/discourse/views/modal/archetype_options_view.js b/app/assets/javascripts/discourse/views/modal/archetype_options_view.js index b403b37d9..fe853c519 100644 --- a/app/assets/javascripts/discourse/views/modal/archetype_options_view.js +++ b/app/assets/javascripts/discourse/views/modal/archetype_options_view.js @@ -28,5 +28,3 @@ Discourse.ArchetypeOptionsView = Em.ContainerView.extend({ } }); - - diff --git a/app/assets/javascripts/discourse/views/post_menu_view.js b/app/assets/javascripts/discourse/views/post_menu_view.js index 8bbc68964..36ccf9aa4 100644 --- a/app/assets/javascripts/discourse/views/post_menu_view.js +++ b/app/assets/javascripts/discourse/views/post_menu_view.js @@ -162,5 +162,3 @@ Discourse.PostMenuView = Discourse.View.extend({ } }); - - diff --git a/app/assets/javascripts/discourse/views/view.js b/app/assets/javascripts/discourse/views/view.js index aa796336b..69bf24b1e 100644 --- a/app/assets/javascripts/discourse/views/view.js +++ b/app/assets/javascripts/discourse/views/view.js @@ -8,5 +8,3 @@ @module Discourse **/ window.Discourse.View = Ember.View.extend(Discourse.Presence, {}); - - diff --git a/app/assets/javascripts/external/Markdown.Converter.js b/app/assets/javascripts/external/Markdown.Converter.js index 22808c5b3..39fbc5d83 100644 --- a/app/assets/javascripts/external/Markdown.Converter.js +++ b/app/assets/javascripts/external/Markdown.Converter.js @@ -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
. 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](). 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, "
\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 = "\""` blocks. - // + // /* text = text.replace(/ @@ -1004,26 +1004,26 @@ else function _DoCodeSpans(text) { // // * Backtick quotes are used for 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: - // + // //

Just type foo `bar` baz at the prompt.

- // + // // 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 `bar` ... // @@ -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 - - var replacer = function (wholematch, m1) { + + var replacer = function (wholematch, m1) { m1encoded = m1.replace(/\_\_/, '%5F%5F'); - return "" + pluginHooks.plainLinkText(m1) + ""; + return "" + pluginHooks.plainLinkText(m1) + ""; } 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 ""; diff --git a/app/assets/javascripts/external/Markdown.Editor.js b/app/assets/javascripts/external/Markdown.Editor.js index 37ea886f3..7496bd062 100644 --- a/app/assets/javascripts/external/Markdown.Editor.js +++ b/app/assets/javascripts/external/Markdown.Editor.js @@ -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 = ""; diff --git a/app/assets/javascripts/external/Markdown.Sanitizer.js b/app/assets/javascripts/external/Markdown.Sanitizer.js index cc5826fa8..c3283e590 100644 --- a/app/assets/javascripts/external/Markdown.Sanitizer.js +++ b/app/assets/javascripts/external/Markdown.Sanitizer.js @@ -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 @@ /// /// 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 /// function balanceTags(html) { diff --git a/app/assets/javascripts/external/bootstrap-button.js b/app/assets/javascripts/external/bootstrap-button.js index 11ecb9d61..6c0371d3c 100644 --- a/app/assets/javascripts/external/bootstrap-button.js +++ b/app/assets/javascripts/external/bootstrap-button.js @@ -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); \ No newline at end of file +}(window.jQuery); diff --git a/app/assets/javascripts/external/chosen.jquery.js b/app/assets/javascripts/external/chosen.jquery.js index d6e75eadf..9ae0bac34 100644 --- a/app/assets/javascripts/external/chosen.jquery.js +++ b/app/assets/javascripts/external/chosen.jquery.js @@ -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 diff --git a/app/assets/javascripts/external/ember.js b/app/assets/javascripts/external/ember.js index ed42c6f05..158146f5f 100644 --- a/app/assets/javascripts/external/ember.js +++ b/app/assets/javascripts/external/ember.js @@ -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 `` 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 ``` 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("