Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into asdsad
Browse files Browse the repository at this point in the history
  • Loading branch information
w20k committed Oct 12, 2016
2 parents ec5e63b + 999587a commit 05d8e2b
Show file tree
Hide file tree
Showing 25 changed files with 608 additions and 288 deletions.
2 changes: 0 additions & 2 deletions languages/en.json

This file was deleted.

101 changes: 101 additions & 0 deletions src/languages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"chat": {
"actions": {
"banUser": "Ban User",
"makeMod": "Make Moderator",
"makeAdmin": "Make Admin",
"makeUser": "Make User",
"close": "Close",
"invite": "Invite to Chat ",
"createChat": "Create Chat",
"joinChat": "Join Chat",
"createAddChat": "Click to create additional chat",
"copyIdPasswort": "Copy Password&Id",
"deleteRoom": "Delete Room",
"leaveRoom": "Leave Room"
},
"texts": {
"settings": "More settings at ",
"account": "Account",
"title": "Chat",
"creditEmoticon": "Emoticons provided by ",
"optional": "This part of the script is optional, so logging in is unneeded for raid catching etc.",
"invalid": "This should not be the data for logging in on the related gaming site and the login does not need to match your ingame name - you can set a display name after the registration.",
"offline": "Not logged in, click to login/register"
},
"error": {
"modify": "Can't modify that user at the moment",
"create": "Can't create at the moment",
"join": "Joining didn't work",
"login": "Login failed in an unexpected way",
"unknown": "The given username for dotd.idrinth.de is unknown, do you want to register it there?"
},
"notification": {
"mention": "chat-mention notifications?",
"raid": "chat-raid notifications?",
"message": "chat-message notifications?"
}
},
"default": "Unexpected error occurred. Please contact script developers (https://github.com/Idrinth/IDotD).",
"land": {
"lack": "You lack gold to buy any more buildings at the moment.",
"hour": " gold per hour each",
"calc": "Calculate",
"avaible": "Avaible Gold"
},
"tier": {
"search": "Enter Boss' Name",
"diff": {
"normal": "Normal",
"hard": "Hard",
"legend": "Legend",
"night": "Nightmare"
},
"tag": "Tag to screen-top",
"maxBoxes": "There is no space for another tier-box at the moment, please close one first."
},
"raids": {
"lastJoined": "Last raids joined",
"clear": "Clear Raids",
"disableJoining": "Disable joining for ",
"clickCopy": "click to copy raid link",
"imports": {
"manually": "Import all manually",
"favs": "Import favs manually",
"restart": "Restart Raidjoin"
},
"disableSpecific": "Disable Autojoining for specific raids"
},
"button": {
"ok": "Ok",
"cancel": "Cancel",
"reloadGame": "Reload game",
"reloadScript": "Reload Script",
"refreshFBGameLogin": "Refresh Facebook Game Login",
"ngRaidJoin": "NG Raid Join(slow!)",
"disableTimedAutoJoin": "disable timed Autojoin",
"enableTimedAutoJoin": "enable timed Autojoin"
},
"setting": {
"enableExtCharInfo": "Enable extended Characterinformation?",
"minimLayout": "Minimalist Layout",
"moveSettingLeft": "Move settings left",
"warBottomPage": "Show war at the bottom of the page",
"useGoldEfficiently": "Check to try and use up the gold as efficient as possible - uncheck to only use the most efficient buy in the land buy calculator",
"tenBuildOnce": "Buy 10 Buildings at once?(Rec)",
"extCharInfoDuration": "Milliseconds until the extended Characterinformation disappears",
"joiningDuration": "Seconds needed to load the game for joining",
"enableChat": "Enable chat(needs script reload)",
"enableFavRequest": "Enable Auto-Raid-Request for Favorites?",
"favIdToJoin": "FavoriteIds to join (separate multiple by comma)",
"worldserver": "Worldserver?"
},
"ui": {
"settingInfo": "This script will always import the raids you manually set to be imported on the website and if it's enabled it will also import all raids matched by one of the faved searches provided.",
"maxPopupsFrame": "Maximum Popups/Frames for joining raids",
"timeAutoJoin": "Time to automatically join raids slowly(reloads game multiple times). Format is [Hours]:[Minutes] without leading zeros, so 7:1 is fine, 07:01 is not",
"getFavFrom": "Get your search-favorites from ",
"raidsearch": "Idrinth's Raidsearch",
"reloadGameFail": "The game couldn't be reloaded"
}
}
62 changes: 31 additions & 31 deletions src/mods/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ idrinth.chat = {
};
var messageAllowed = function ( text ) {
try {
return ( idrinth.settings.notification.message && text.match ( /\{[A-Z]{2}-Raid / ) === null ) ||
( idrinth.settings.notification.mention && text.match ( new RegExp ( '(\s|^)' + idrinth.core.escapeRegExp ( idrinth.chat.users[idrinth.chat.self].name ) + '(\s|$)', 'i' ) ) !== null ) ||
( idrinth.settings.notification.raid && text.match ( /\{[A-Z]{2}-Raid / ) !== null );
return ( idrinth.settings.get ( "notification#message" ) && text.match ( /\{[A-Z]{2}-Raid / ) === null ) ||
( idrinth.settings.get ( "notification#mention" ) && text.match ( new RegExp ( '(\s|^)' + idrinth.core.escapeRegExp ( idrinth.chat.users[idrinth.chat.self].name ) + '(\s|$)', 'i' ) ) !== null ) ||
( idrinth.settings.get ( "notification#raid" ) && text.match ( /\{[A-Z]{2}-Raid / ) !== null );
} catch ( e ) {
idrinth.core.log ( e.getMessage () );
return false;
Expand Down Expand Up @@ -544,11 +544,11 @@ idrinth.chat = {
};
return idrinth.ui.buildElement ( {
id: 'idrinth-chat',
css: 'idrinth-hovering-box' + ( !idrinth.settings.chatHiddenOnStart ? ' active' : '' ) + ( idrinth.settings.moveLeft ? ' left-sided' : '' ),
css: 'idrinth-hovering-box' + ( !idrinth.settings.get ( "chatHiddenOnStart" ) ? ' active' : '' ) + ( idrinth.settings.get ( "moveLeft" ) ? ' left-sided' : '' ),
children: [
{
type: 'button',
content: ( idrinth.settings.chatHiddenOnStart ? '<<' : '>>' ),
content: ( idrinth.settings.get ( "chatHiddenOnStart" ) ? '<<' : '>>' ),
attributes: [ {
name: 'onclick',
value: 'idrinth.chat.openCloseChat(this);'
Expand Down Expand Up @@ -586,29 +586,29 @@ idrinth.chat = {
children: [
{
type: 'h1',
content: idrinth.text.get ( "chat.ui.chat" )
content: idrinth.text.get ( "chat.texts.title" )
},
{
type: 'p',
content: idrinth.text.get ( "chat.message.optional" )
content: idrinth.text.get ( "chat.texts.optional" )
}, {
id: 'idrinth-chat-login',
children: [
{
type: 'h2',
content: idrinth.text.get ( "chat.ui.account" )
content: idrinth.text.get ( "chat.texts.account" )
},
{
type: 'p',
content: idrinth.text.get ( "chat.message.invalid" )
content: idrinth.text.get ( "chat.texts.invalid" )
},
{
type: 'ul',
css: 'settings',
children: [
makeInput ( 'Username' ),
makeInput ( 'Password' ),
makeButton ( 'chat.message.offline', "idrinth.chat.login()" )
makeButton ( 'chat.texts.offline', "idrinth.chat.login()" )
]
}
]
Expand All @@ -617,15 +617,15 @@ idrinth.chat = {
children: [
{
type: 'h2',
content: idrinth.text.get ( "chat.ui.joinChat" )
content: idrinth.text.get ( "chat.actions.joinChat" )
},
{
type: 'ul',
css: 'settings',
children: [
makeInput ( 'Chat-ID' ),
makeInput ( 'Chat-Password' ),
makeButton ( 'chat.ui.createAddChat', "idrinth.chat.add()" )
makeButton ( 'chat.actions.createAddChat', "idrinth.chat.add()" )
]
}
]
Expand All @@ -635,14 +635,14 @@ idrinth.chat = {
children: [
{
type: 'h2',
content: idrinth.text.get ( "chat.ui.createChat" )
content: idrinth.text.get ( "chat.actions.createChat" )
},
{
type: 'ul',
css: 'settings',
children: [
makeInput ( "Name" ),
makeButton ( 'chat.ui.createAddChat', "idrinth.chat.create()" )
makeButton ( 'chat.actions.createAddChat', "idrinth.chat.create()" )
]
}
]
Expand All @@ -651,7 +651,7 @@ idrinth.chat = {
children: [
{
type: '#text',
content: idrinth.text.get ( "chat.ui.moreSettings" )
content: idrinth.text.get ( "chat.texts.settings" )
},
{
type: 'a',
Expand All @@ -677,7 +677,7 @@ idrinth.chat = {
children: [
{
type: '#text',
content: idrinth.text.get ( "chat.ui.creditEmoticon" )
content: idrinth.text.get ( "chat.texts.creditEmoticon" )
},
{
type: 'a',
Expand Down Expand Up @@ -706,7 +706,7 @@ idrinth.chat = {
]
} );
};
if ( !idrinth.settings.chatting ) {
if ( !idrinth.settings.get ( "chatting" ) ) {
return;
}
if ( !document.getElementById ( 'idrinth-chat' ) ) {
Expand All @@ -724,8 +724,8 @@ idrinth.chat = {
window.setTimeout ( idrinth.chat.login, 1 );
},
JSON.stringify ( {
user: idrinth.settings.chatuser,
pass: idrinth.settings.chatpass
user: idrinth.settings.get ( "chatuser" ),
pass: idrinth.settings.get ( "chatpass" )
} )
);
}, 2500 );
Expand Down Expand Up @@ -839,17 +839,17 @@ idrinth.chat = {
return;
}
if ( !data.success && data.message && data['allow-reg'] ) {
idrinth.core.confirm ( idrinth.text.get ( "chat.message.unknown" ), 'idrinth.chat.register();' );
idrinth.core.confirm ( idrinth.text.get ( "chat.error.unknown" ), 'idrinth.chat.register();' );
return;
}
if ( !data.success && data.message ) {
idrinth.core.alert ( data.message );
return;
}
if ( data.success ) {
idrinth.settings.chatuser = document.getElementById ( 'idrinth-chat-login' ).getElementsByTagName ( 'input' )[0].value;
idrinth.settings.chatpass = document.getElementById ( 'idrinth-chat-login' ).getElementsByTagName ( 'input' )[1].value;
idrinth.settings.save ();
var login = document.getElementById ( 'idrinth-chat-login' ).getElementsByTagName ( 'input' );
idrinth.settings.change ( "chatuser", login[0].value );
idrinth.settings.change ( "chatpass", login[1].value );
idrinth.ui.removeElement ( 'idrinth-chat-login' );
idrinth.chat.join ( data.data );
return;
Expand All @@ -872,29 +872,29 @@ idrinth.chat = {
css: 'idrinth-hovering-box',
children: [ {
css: 'clipboard-copy',
content: idrinth.text.get ( "chat.ui.copyIdPasswort" ),
content: idrinth.text.get ( "chat.actions.copyIdPasswort" ),
type: 'li',
attributes: [ {
name: 'data-clipboard-text',
value: element.getAttribute ( 'title' )
} ]
}, {
content: idrinth.text.get ( "chat.ui.leaveRoom" ),
content: idrinth.text.get ( "chat.actions.leaveRoom" ),
type: 'li',
attributes: [ {
name: 'onclick',
value: 'idrinth.chat.useroptions(' + element.getAttribute ( 'data-id' ) + ',' + idrinth.chat.self + ',\'Leave\');this.parentNode.parentNode.removeChild(this.parentNode);'
} ]
}, {
content: idrinth.text.get ( "chat.ui.deleteRoom" ),
content: idrinth.text.get ( "chat.actions.deleteRoom" ),
type: 'li',
attributes: [ {
name: 'onclick',
value: 'idrinth.core.ajax.runHome(\'chat-service/delete/' + element.getAttribute ( 'data-id' ) + '/\',idrinth.core.alert,idrinth.core.alert,idrinth.core.alert);this.parentNode.parentNode.removeChild(this.parentNode);'
} ]
}, {
type: 'li',
content: idrinth.text.get ( "chat.ui.close" ),
content: idrinth.text.get ( "chat.actions.close" ),
attributes: [ {
name: 'onclick',
value: 'this.parentNode.parentNode.removeChild(this.parentNode);'
Expand Down Expand Up @@ -927,11 +927,11 @@ idrinth.chat = {
openCloseChat: function ( element ) {
var chat = element.parentNode;
if ( chat.getAttribute ( 'class' ) === 'idrinth-hovering-box active' || chat.getAttribute ( 'class' ) === 'idrinth-hovering-box active left-sided' ) {
chat.setAttribute ( 'class', 'idrinth-hovering-box' + ( idrinth.settings.moveLeft ? ' left-sided' : '' ) +
chat.setAttribute ( 'class', 'idrinth-hovering-box' + ( idrinth.settings.get ( "moveLeft" ) ? ' left-sided' : '' ) +
( chat.getElementsByClassName ( 'new-message' ) && chat.getElementsByClassName ( 'new-message' ).length ? ' new-message' : '' ) );
element.innerHTML = '&lt;&lt;';
} else {
chat.setAttribute ( 'class', 'idrinth-hovering-box active' + ( idrinth.settings.moveLeft ? ' left-sided' : '' ) );
chat.setAttribute ( 'class', 'idrinth-hovering-box active' + ( idrinth.settings.get ( "moveLeft" ) ? ' left-sided' : '' ) );
element.innerHTML = '&gt;&gt;';
}
},
Expand Down Expand Up @@ -962,8 +962,8 @@ idrinth.chat = {
success = function () {
idrinth.chat.updateTimeout = window.setTimeout ( idrinth.chat.refreshChats, 1500 );
};
headers.user = idrinth.settings.chatuser;
headers.pass = idrinth.settings.chatpass;
headers.user = idrinth.settings.get ( "chatuser" );
headers.pass = idrinth.settings.get ( "chatpass" );
} else {
chatLogin = document.getElementById ( 'idrinth-chat-login' ).getElementsByTagName ( 'input' );
headers.user = chatLogin[0].value;
Expand Down
2 changes: 1 addition & 1 deletion src/mods/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ idrinth.core = {
},
ajax: {
runHome: function ( url, success, failure, timeout, additionalHeader, isStatic ) {
var server = isStatic ? 'static' : ( idrinth.settings.isWorldServer ? 'world-' : '' ) + idrinth.platform;
var server = isStatic ? 'static' : ( idrinth.settings.get ( "isWorldServer" ) ? 'world-' : '' ) + idrinth.platform;
var homeUrl = 'https://dotd.idrinth.de/' + server + ( '/' + url ).replace ( /\/\//, '/' );
idrinth.core.ajax.run ( homeUrl, success, failure, timeout, additionalHeader );
},
Expand Down
Loading

0 comments on commit 05d8e2b

Please sign in to comment.