Skip to content

Commit

Permalink
Merge pull request elkarte#123 from Spuds/Admin
Browse files Browse the repository at this point in the history
! using A reserved js word is not a good idea i.e. Doh!
  • Loading branch information
norv committed Jan 30, 2013
2 parents d8c755b + 18aa490 commit d0d1ab6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
12 changes: 8 additions & 4 deletions themes/CurveClassic/Admin.template.php
Expand Up @@ -575,7 +575,7 @@ function template_view_versions()
<tbody>
<tr>
<td class="windowbg" width="50%">
<a href="#" id="default-link">', $txt['dvc_default'], '</a>
<a href="#" id="Default-link">', $txt['dvc_default'], '</a>
</td>
<td class="windowbg" width="25%">
<em id="yourdefault">??</em>
Expand All @@ -587,7 +587,7 @@ function template_view_versions()
</tbody>
</table>
<table id="default" width="100%" class="table_grid">
<table id="Default" width="100%" class="table_grid">
<tbody>';

foreach ($context['default_template_versions'] as $filename => $version)
Expand Down Expand Up @@ -707,8 +707,12 @@ function template_view_versions()
\'.', $context['default_known_languages']), '\'
],
oSectionContainerIds: {
Sources: \'Sources\',
default: \'default\',
sources: \'sources\',
admin: \'admin\',
controllers: \'controllers\',
database: \'database\',
subs: \'subs\',
Default: \'Default\',
Languages: \'Languages\',
Templates: \'Templates\'
}
Expand Down
8 changes: 4 additions & 4 deletions themes/default/Admin.template.php
Expand Up @@ -572,7 +572,7 @@ function template_view_versions()
<tbody>
<tr>
<td class="windowbg" width="50%">
<a href="#" id="default-link">', $txt['dvc_default'], '</a>
<a href="#" id="Default-link">', $txt['dvc_default'], '</a>
</td>
<td class="windowbg" width="25%">
<em id="yourdefault">??</em>
Expand All @@ -584,7 +584,7 @@ function template_view_versions()
</tbody>
</table>
<table id="default" width="100%" class="table_grid">
<table id="Default" width="100%" class="table_grid">
<tbody>';

foreach ($context['default_template_versions'] as $filename => $version)
Expand Down Expand Up @@ -706,10 +706,10 @@ function template_view_versions()
oSectionContainerIds: {
sources: \'sources\',
admin: \'admin\',
controllers: \'conrtollers\',
controllers: \'controllers\',
database: \'database\',
subs: \'subs\',
default: \'default\',
Default: \'Default\',
Languages: \'Languages\',
Templates: \'Templates\'
}
Expand Down
28 changes: 14 additions & 14 deletions themes/default/scripts/admin.js
Expand Up @@ -211,7 +211,7 @@ smf_ViewVersions.prototype.determineVersions = function ()
controllers: '??',
database: '??',
subs: '??',
default: '??',
Default: '??',
Languages: '??',
Templates: '??'
};
Expand All @@ -221,7 +221,7 @@ smf_ViewVersions.prototype.determineVersions = function ()
controllers: '??',
database: '??',
subs: '??',
default: '??',
Default: '??',
Languages: '??',
Templates: '??'
};
Expand All @@ -231,7 +231,7 @@ smf_ViewVersions.prototype.determineVersions = function ()
controllers: false,
database: false,
subs: false,
default: false,
Default: false,
Languages: false,
Templates: false
};
Expand All @@ -242,7 +242,7 @@ smf_ViewVersions.prototype.determineVersions = function ()
'controllers',
'database',
'subs',
'default',
'Default',
'Languages',
'Templates'
];
Expand All @@ -251,12 +251,12 @@ smf_ViewVersions.prototype.determineVersions = function ()
{
// Collapse all sections.
var oSection = document.getElementById(sSections[i]);
if (typeof(oSection) == 'object' && oSection != null)
if (typeof(oSection) === 'object' && oSection !== null)
oSection.style.display = 'none';

// Make all section links clickable.
var oSectionLink = document.getElementById(sSections[i] + '-link');
if (typeof(oSectionLink) == 'object' && oSectionLink != null)
if (typeof(oSectionLink) === 'object' && oSectionLink !== null)
{
oSectionLink.instanceRef = this;
oSectionLink.sSection = sSections[i];
Expand Down Expand Up @@ -287,12 +287,12 @@ smf_ViewVersions.prototype.determineVersions = function ()
}

// use compareVersion to determine which version is >< the other
if (typeof(sCurVersionType) != 'undefined')
if (typeof(sCurVersionType) !== 'undefined')
{
if ((this.compareVersions(oHighYour[sCurVersionType], sYourVersion) || oHighYour[sCurVersionType] == '??') && !oLowVersion[sCurVersionType])
if ((this.compareVersions(oHighYour[sCurVersionType], sYourVersion) || oHighYour[sCurVersionType] === '??') && !oLowVersion[sCurVersionType])
oHighYour[sCurVersionType] = sYourVersion;

if (this.compareVersions(oHighCurrent[sCurVersionType], ourVersions[sFilename]) || oHighCurrent[sCurVersionType] == '??')
if (this.compareVersions(oHighCurrent[sCurVersionType], ourVersions[sFilename]) || oHighCurrent[sCurVersionType] === '??')
oHighCurrent[sCurVersionType] = ourVersions[sFilename];

if (this.compareVersions(sYourVersion, ourVersions[sFilename]))
Expand Down Expand Up @@ -323,9 +323,9 @@ smf_ViewVersions.prototype.determineVersions = function ()
sYourVersion = getInnerHTML(document.getElementById('your' + sFilename + this.opt.aKnownLanguages[i]));
setInnerHTML(document.getElementById('your' + sFilename + this.opt.aKnownLanguages[i]), sYourVersion);

if ((this.compareVersions(oHighYour.Languages, sYourVersion) || oHighYour.Languages == '??') && !oLowVersion.Languages)
if ((this.compareVersions(oHighYour.Languages, sYourVersion) || oHighYour.Languages === '??') && !oLowVersion.Languages)
oHighYour.Languages = sYourVersion;
if (this.compareVersions(oHighCurrent.Languages, ourLanguageVersions[sFilename]) || oHighCurrent.Languages == '??')
if (this.compareVersions(oHighCurrent.Languages, ourLanguageVersions[sFilename]) || oHighCurrent.Languages === '??')
oHighCurrent.Languages = ourLanguageVersions[sFilename];

if (this.compareVersions(sYourVersion, ourLanguageVersions[sFilename]))
Expand Down Expand Up @@ -362,9 +362,9 @@ smf_ViewVersions.prototype.determineVersions = function ()
if (oLowVersion.sources)
document.getElementById('yoursubs').style.color = 'red';

setInnerHTML(document.getElementById('yourdefault'), oLowVersion.default ? oLowVersion.default : oHighYour.default);
setInnerHTML(document.getElementById('ourdefault'), oHighCurrent.default);
if (oLowVersion.default)
setInnerHTML(document.getElementById('yourdefault'), oLowVersion.Default ? oLowVersion.Default : oHighYour.Default);
setInnerHTML(document.getElementById('ourdefault'), oHighCurrent.Default);
if (oLowVersion.Default)
document.getElementById('yourdefault').style.color = 'red';

if (document.getElementById('Templates'))
Expand Down

0 comments on commit d0d1ab6

Please sign in to comment.