Skip to content

Commit

Permalink
#184 assistant layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Apr 2, 2016
1 parent 06fc98e commit 6cec097
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions Extension/lib/content-script/assistant/js/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,25 +450,25 @@ var AdguardAssistant = function ($) {
' <div class="element-rule_form" id="adv-settings">' +
' <div class="element-rule_form-cont">' +
' <div class="element-rule_fieldset" id="one-domain-checkbox-block">' +
' <input class="form-ui-control" id="one-domain-checkbox" type="checkbox">' +
' <input class="form-ui-control" id="one-domain-checkbox" type="checkbox"/>' +
' <label for="one-domain-checkbox" class="form-ui">' +
' <span i18n="assistant_apply_rule_to_all_sites" class="form-ui-txt"></span>' +
' </label>' +
' </div>' +
' <div style="display: none;" class="element-rule_fieldset" id="block-by-url-checkbox-block">' +
' <input class="form-ui-control" id="block-by-url-checkbox" type="checkbox">' +
' <input class="form-ui-control" id="block-by-url-checkbox" type="checkbox"/>' +
' <label for="block-by-url-checkbox" class="form-ui">' +
' <span i18n="assistant_block_by_reference" class="form-ui-txt"></span>' +
' </label>' +
' </div>' +
' <div style="display: none;" class="element-rule_fieldset" id="block-similar-checkbox-block">' +
' <input class="form-ui-control" id="block-similar-checkbox" type="checkbox">' +
' <input class="form-ui-control" id="block-similar-checkbox" type="checkbox"/>' +
' <label for="block-similar-checkbox" class="form-ui">' +
' <span i18n="assistant_block_similar" class="form-ui-txt"></span>' +
' </label>' +
' </div>' +
' <div class="element-rule_fieldset">' +
' <input class="form-control" id="filter-rule" type="text">' +
' <input class="form-control" id="filter-rule" type="text"/>' +
' </div>' +
' </div>' +
' </div>' +
Expand Down Expand Up @@ -793,3 +793,37 @@ var AdguardAssistant = function ($) {
closeAssistant();
}
};

function Deferred() {
this._context = null;
this._done = [];
this._fail = [];
}


Deferred.prototype = {
execute: function (list, args) {
var i = list.length;

// convert arguments to an array
// so they can be sent to the
// callbacks via the apply method
args = Array.prototype.slice.call(args);

while (i--) list[i].apply(this._context, args);
},
resolve: function () {
this.execute(this._done, arguments);
},
reject: function () {
this.execute(this._fail, arguments);
},
done: function (callback, ctx) {
this._context = ctx;
this._done.push(callback);
},
fail: function (callback, ctx) {
this._context = ctx;
this._fail.push(callback);
}
};

0 comments on commit 6cec097

Please sign in to comment.