Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Extension and icon for .url and .website files
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 14, 2014
1 parent ab7e38d commit cebab83
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 38 deletions.
41 changes: 9 additions & 32 deletions core/src/plugins/editor.browser/manifest.xml
Expand Up @@ -18,6 +18,7 @@
<img_library alias="openbrowser_images" path="plugins/editor.browser/resources/images" />
</resources>
</client_settings>

<clientForm id="open_box"><![CDATA[
<div id="open_box" action="editer" box_width="185" class="editor_container">
AJXP_MESSAGE[openbrowser.3]
Expand Down Expand Up @@ -46,48 +47,20 @@
<clientCallback prepareModal="true"><![CDATA[
modal.showDialogForm('Create', 'mklink_form', null, function(){
var parseLinkUrl = function (url) {
var parser = document.createElement('a'),
searchObject = {},
queries, split, i;
parser.href = url;
queries = parser.search.replace(/^\?/, '').split('&');
for( i = 0; i < queries.length; i++ ) {
split = queries[i].split('=');
searchObject[split[0]] = split[1];
}
return {
protocol: parser.protocol,
host: parser.host,
hostname: parser.hostname,
port: parser.port,
pathname: parser.pathname,
search: parser.search,
searchObject: searchObject,
hash: parser.hash
};
}
var oForm = modal.getForm();
var data = oForm.down("#content").getValue();
var base = slugString(parseLinkUrl(data)['host']);
var i = 1;
var basename = base;
while( ajaxplorer.getContextHolder().fileNameExists(basename + '.url') ) {
basename = base + '-' + i;
i = i+1;
}
oForm.down("#filename").setValue(basename + '.url');
oForm.down("#filename").setValue(oForm.down("#filename").getValue()+ '.url');
ajaxplorer.actionBar.submitForm(oForm);
hideLightBox(true);
return false;
});
]]></clientCallback>
<clientForm id="mklink_form"><![CDATA[
<div id="mklink_form" action="mkfile">
<div class="dialogLegend" ajxp_message_id="openbrowser.6">AJXP_MESSAGE[openbrowser.6]</div>
<input type="hidden" id="filename" name="filename" value="bookmark.url">
<input type="text" id="content" style="width:390px;" name="content" placeholder="http[s]://" class="dialogFocus">
<div class="dialogLegend" ajxp_message_id="openbrowser.8">AJXP_MESSAGE[openbrowser.8]</div>
<input type="text" id="filename" style="width:390px;" name="filename" value="">
</div>
]]></clientForm>
<clientListener name="init"><![CDATA[
Expand All @@ -103,5 +76,9 @@
</processing>
</action>
</actions>
<extensions>
<extension icon="openbrowser_images/earth.png" messageId="openbrowser.7" mime="url"/>
<extension icon="openbrowser_images/earth.png" messageId="openbrowser.7" mime="website"/>
</extensions>
</registry_contributions>
</editor>
4 changes: 3 additions & 1 deletion core/src/plugins/editor.browser/resources/i18n/de.php
Expand Up @@ -24,5 +24,7 @@
"3" => "Bitte warten, die Datei wird in einen externen Fenster geöffnet und dieses Fenster schließt sich automatisch.",
"4" => "New URL Bookmark",
"5" => "Alternatively, you can <a>create a new bookmark to an URL</a>",
"6" => "Enter an URL starting with http/https"
"6" => "Enter an URL starting with http/https",
"7" => "URL Bookmark",
"8" => "Enter a label for this bookmark"
);
4 changes: 3 additions & 1 deletion core/src/plugins/editor.browser/resources/i18n/en.php
Expand Up @@ -24,5 +24,7 @@
"3" => "Opening file in external window, please wait, this window should close automatically.",
"4" => "New URL Bookmark",
"5" => "Alternatively, you can <a>create a new bookmark to an URL</a>",
"6" => "Enter an URL starting with http/https"
"6" => "Enter an URL starting with http/https",
"7" => "URL Bookmark",
"8" => "Enter a label for this bookmark"
);
4 changes: 3 additions & 1 deletion core/src/plugins/editor.browser/resources/i18n/es.php
Expand Up @@ -24,5 +24,7 @@
"3" => "Abriendo el fichero en una ventana externa, espere por favor, esta ventana se cerrará automáticamente.",
"4" => "New URL Bookmark",
"5" => "Alternatively, you can <a>create a new bookmark to an URL</a>",
"6" => "Enter an URL starting with http/https"
"6" => "Enter an URL starting with http/https",
"7" => "URL Bookmark",
"8" => "Enter a label for this bookmark"
);
4 changes: 3 additions & 1 deletion core/src/plugins/editor.browser/resources/i18n/et.php
Expand Up @@ -28,5 +28,7 @@
"3" => "Avan faili välises aknas, palun oota, see teade sulgub automaatselt.",
"4" => "New URL Bookmark",
"5" => "Alternatively, you can <a>create a new bookmark to an URL</a>",
"6" => "Enter an URL starting with http/https"
"6" => "Enter an URL starting with http/https",
"7" => "URL Bookmark",
"8" => "Enter a label for this bookmark"
);
2 changes: 2 additions & 0 deletions core/src/plugins/editor.browser/resources/i18n/fr.php
Expand Up @@ -25,4 +25,6 @@
"4" => "Nouveau Favori (URL)",
"5" => "Vous pouvez aussi <a>créer un favori vers une URL</a>",
"6" => "Entrer une adresse internet commencant par http/https",
"7" => "Favori",
"8" => "Entrer un libellé pour ce favori."
);
4 changes: 3 additions & 1 deletion core/src/plugins/editor.browser/resources/i18n/pt.php
Expand Up @@ -24,5 +24,7 @@
"3" => "A Abrir ficheiro numa janela Externa, por favor aguarde, esta janela deverá ser fechada automaticamente.",
"4" => "New URL Bookmark",
"5" => "Alternatively, you can <a>create a new bookmark to an URL</a>",
"6" => "Enter an URL starting with http/https"
"6" => "Enter an URL starting with http/https",
"7" => "URL Bookmark",
"8" => "Enter a label for this bookmark"
);
4 changes: 3 additions & 1 deletion core/src/plugins/editor.browser/resources/i18n/ru.php
Expand Up @@ -24,5 +24,7 @@
"3" => "Открытие файла в окне просмотра, подождите, это окно автоматически закроется.",
"4" => "New URL Bookmark",
"5" => "Alternatively, you can <a>create a new bookmark to an URL</a>",
"6" => "Enter an URL starting with http/https"
"6" => "Enter an URL starting with http/https",
"7" => "URL Bookmark",
"8" => "Enter a label for this bookmark"
);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cebab83

Please sign in to comment.