Skip to content
Permalink
Browse files

- Ajout des DropdownList

- Ajout d'une optin (non fonctionnelle) pour choisir le type de citation
  dans Quote
- Mise à jour du bat
  • Loading branch information...
dorian-marchal committed Aug 23, 2014
1 parent b2c868c commit cbd2cef71bef14ad9537da1d923375dcbb71e622
Showing with 59 additions and 19 deletions.
  1. +12 −5 DropdownList.js
  2. +1 −1 modules/Quote.js
  3. +23 −11 modules/Settings.js
  4. +1 −0 modules/StartSpawnKill.js
  5. +22 −2 other/update-plugin.bat
@@ -24,15 +24,22 @@ SK.DropdownList = function(options) {

var $select = $("<select>", selectOptions);

$select
.addClass("sk-dropdown-select")
.prop("checked", defaultValue);
$select.addClass("sk-dropdown-select");

//On ajoute les options
for(var value in values) {
$select.append($("<option>", {

var $option = $("<option>", {
value: value,
text: values[value]
}));
});

$select.append($option);

//On sélectionne la valeur par défaut
if(defaultValue === value) {
$option.prop("selected", true);
}
}

$dropdown.append($select);
@@ -394,7 +394,7 @@ SK.moduleConstructors.Quote.prototype.settings = {
},
quoteType: {
title: "Type de citation",
description: "Chopix du type de citation en mode texte (citations que verront ceux qui n'ont pas SpawnKill).",
description: "Choix du type de citation en mode texte (citations que verront ceux qui n'ont pas SpawnKill).",
type: "select",
options: { spawnkill: "SpawnKill", turboforum: "JVC TurboForum", jvcmaster: "JVC Master" },
default: "spawnkill",
@@ -117,7 +117,7 @@ SK.moduleConstructors.Settings.prototype.getSettingsUI = function() {
ui += "<ul class='options fold' >";
for(var settingKey in module.settings) {
var setting = module.settings[settingKey];
ui += "<li class='option' title='" + SK.Util.htmlEncode(setting.description) + "' data-type='" + setting.type + "' data-value='" + getOptionStringValue(setting) + "' data-id='" + settingKey + "' >";
ui += "<li class='option' title='" + SK.Util.htmlEncode(setting.description) + "' data-id='" + settingKey + "' >";
ui += SK.Util.htmlEncode(module.settings[settingKey].title);
ui += "</li>";
}
@@ -135,6 +135,7 @@ SK.moduleConstructors.Settings.prototype.getSettingsUI = function() {
var $mainSetting = $setting.find(".main-setting");
var disabled = $mainSetting.parent().hasClass("required");
var subOptions = $mainSetting.siblings(".options").find(".option");
var module = SK.modules[$(this).attr("data-id")];

//Slide-toggles Settings
$mainSetting.append(new SK.SlideToggle({
@@ -167,20 +168,21 @@ SK.moduleConstructors.Settings.prototype.getSettingsUI = function() {
}

//Slide-toggles Options

$setting.find(".option").each(function() {

var $option = $(this);
var value = $option.attr("data-value");
var type = $option.attr("data-type");
var option = module.settings[$option.attr("data-id")];

if(type === "boolean") {
if(option.type === "boolean") {
$option.append(new SK.SlideToggle({
value: value === "1",
value: option.value,
}));
}
else if(type === "select") {
else if(option.type === "select") {
$option.append(new SK.DropdownList({
values: { test: "Test", toast: "Toast", otherItem: "Autre choix" },
value: value
values: option.options,
value: option.value
}));
}
});
@@ -191,19 +193,29 @@ SK.moduleConstructors.Settings.prototype.getSettingsUI = function() {

/** Parcourt l'interface de paramètrage et enregistre les préférences */
SK.moduleConstructors.Settings.prototype.saveSettings = function() {

//On parcourt l'interface et on enregistre les préférences
$("#settings-form .setting").each(function() {
var $setting = $(this);
var settingId = $setting.attr("data-id");
var setting = SK.modules[settingId];
var settingIsActivated = $setting.find(".main-setting .slide-toggle input").prop("checked");
SK.Util.setValue(settingId, settingIsActivated);

//Enregistrement des options des modules
$setting.find(".option").each(function() {
var $option = $(this);
var optionId = settingId + "." + $option.attr("data-id");
var optionValue = $option.find("input").prop("checked");
SK.Util.setValue(optionId, optionValue);
var optionId = $option.attr("data-id");
var option = setting.settings[optionId];
var optionLocalstorageId = settingId + "." + $option.attr("data-id");
var optionValue = null;
if(option.type === "boolean") {
optionValue = $option.find("input").prop("checked");
}
else if(option.type === "select") {
optionValue = $option.find("select").val();
}
SK.Util.setValue(optionLocalstorageId, optionValue);

});

@@ -500,6 +500,7 @@ SK.moduleConstructors.StartSpawnKill.prototype.correctSplitPost = function() {
-webkit-appearance: none;\
-moz-appearance: none;\
appearance: none; \
cursor: pointer;\
}\
.sk-dropdown::before,\
.sk-dropdown::after {\
@@ -1,8 +1,7 @@
cd C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\
del /F /Q *.*
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\jvc-spawnkill.user.js" "C:\wamp\www\spawnkill\jvc-spawnkill.user.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\spin.min.js" "C:\wamp\www\spawnkill\spin.min.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\jquery-1.11.1.min.js" "C:\wamp\www\spawnkill\jquery-1.11.1.min.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\jquery-2.1.1.min.js" "C:\wamp\www\spawnkill\jquery-2.1.1.min.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\base.js" "C:\wamp\www\spawnkill\base.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\jquery-plugins.js" "C:\wamp\www\spawnkill\jquery-plugins.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Util.js" "C:\wamp\www\spawnkill\Util.js"
@@ -11,15 +10,22 @@ mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.defaul
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Button.js" "C:\wamp\www\spawnkill\Button.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\SlideToggle.js" "C:\wamp\www\spawnkill\SlideToggle.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Modal.js" "C:\wamp\www\spawnkill\Modal.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\DropdownList.js" "C:\wamp\www\spawnkill\DropdownList.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Module.js" "C:\wamp\www\spawnkill\modules\Module.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\StartSpawnKill.js" "C:\wamp\www\spawnkill\modules\StartSpawnKill.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\QuickResponse.js" "C:\wamp\www\spawnkill\modules\QuickResponse.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Quote.js" "C:\wamp\www\spawnkill\modules\Quote.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Shortcuts.js" "C:\wamp\www\spawnkill\modules\Shortcuts.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\InfosPseudo.js" "C:\wamp\www\spawnkill\modules\InfosPseudo.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\HilightNewTopic.js" "C:\wamp\www\spawnkill\modules\HilightNewTopic.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\LastPage.js" "C:\wamp\www\spawnkill\modules\LastPage.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Settings.js" "C:\wamp\www\spawnkill\modules\Settings.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\EmbedMedia.js" "C:\wamp\www\spawnkill\modules\EmbedMedia.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\WarnOnNewPost.js" "C:\wamp\www\spawnkill\modules\WarnOnNewPost.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\AutoUpdate.js" "C:\wamp\www\spawnkill\modules\AutoUpdate.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\Test.js" "C:\wamp\www\spawnkill\modules\Test.js"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\ban.png" "C:\wamp\www\spawnkill\images\ban.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\close.png" "C:\wamp\www\spawnkill\images\close.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\topic_new.gif" "C:\wamp\www\spawnkill\images\topic_new.gif"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\carton.png" "C:\wamp\www\spawnkill\images\carton.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\bronze.png" "C:\wamp\www\spawnkill\images\bronze.png"
@@ -35,8 +41,22 @@ mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.defaul
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\plus.png" "C:\wamp\www\spawnkill\images\plus.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\minus.png" "C:\wamp\www\spawnkill\images\minus.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\link.png" "C:\wamp\www\spawnkill\images\link.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\anchor.png" "C:\wamp\www\spawnkill\images\anchor.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\quote.png" "C:\wamp\www\spawnkill\images\quote.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\mp.png" "C:\wamp\www\spawnkill\images\mp.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\alert.png" "C:\wamp\www\spawnkill\images\alert.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\link-gray.png" "C:\wamp\www\spawnkill\images\link-gray.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\calendar.png" "C:\wamp\www\spawnkill\images\calendar.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\clock.png" "C:\wamp\www\spawnkill\images\clock.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\settings.png" "C:\wamp\www\spawnkill\images\settings.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\youtube.png" "C:\wamp\www\spawnkill\images\youtube.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\vimeo.png" "C:\wamp\www\spawnkill\images\vimeo.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\dailymotion.png" "C:\wamp\www\spawnkill\images\dailymotion.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\sondageio.png" "C:\wamp\www\spawnkill\images\sondageio.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\image.png" "C:\wamp\www\spawnkill\images\image.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\vocaroo.png" "C:\wamp\www\spawnkill\images\vocaroo.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\loader.gif" "C:\wamp\www\spawnkill\images\loader.gif"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\big-loader.gif" "C:\wamp\www\spawnkill\images\big-loader.gif"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\error.png" "C:\wamp\www\spawnkill\images\error.png"
mklink "C:\Users\Dorian\AppData\Roaming\Mozilla\Firefox\Profiles\z8o408dk.default\gm_scripts\JVC_SpawnKill\notification.ogg" "C:\wamp\www\spawnkill\audio\notification.ogg"
pause

0 comments on commit cbd2cef

Please sign in to comment.
You can’t perform that action at this time.